Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    May 2016
    Posts
    26

    What is autoboxing and unboxing ?


  2. #2
    Registered User
    Join Date
    Feb 2014
    Location
    delhi
    Posts
    572
    When Java automatically converts a primitive type like int into corresponding wrapper class object e.g. Integer than its called autoboxing because primitive is boxed into wrapper class while in opposite case is called unboxing, where an Integer object is converted into primitive int.

  3. #3
    Senior Member
    Join Date
    May 2016
    Location
    Delhi
    Posts
    144
    Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

  4. #4
    Registered User
    Join Date
    Jan 2016
    Posts
    613
    Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes.

  5. #5
    Junior Member
    Join Date
    Feb 2019
    Location
    Ahemdabad
    Posts
    11
    Auto boxing is to used of Converting a primitive value into an object of the corresponding wrapper class is called auto boxing. For example, converting int to Integer class.and the Unboxing is to used Converting an object of a wrapper type to its corresponding primitive value is called unboxing. For example conversion of Integer to int.
    the example of this

    import java.io.*;

    class Demo
    {
    public static void main (String[] args)
    {

    Integer i = new Integer(10);


    int i1 = i; // unboxing the Object

    System.out.println("Value of i: " + i);
    System.out.println("Value of i1: " + i1);


    Character gfg = 'a'; //Autoboxing of char

    char ch = gfg;
    System.out.println("Value of ch: " + ch);
    System.out.println("Value of gfg: " + gfg);

    }
    }

    http://www.ifourtechnolab.com/
    ASP.NET MVC Developer
    iFour Technolab Private Limited
    Custom ASP.NET MVC Software Company India

  6. #6
    Registered User
    Join Date
    Nov 2016
    Posts
    134
    Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

  7. #7
    Registered User
    Join Date
    Apr 2014
    Posts
    43
    Autoboxing and Unboxing. Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

  8. #8
    Senior Member
    Join Date
    Apr 2019
    Location
    Asia
    Posts
    146
    Autoboxing: Automatic conversion of primitive types to the object of their corresponding wrapper classes is known as autoboxing. For example – conversion of int to Integer, long to Long, double to Double etc.
    Unboxing: It is just the reverse process of autoboxing. Automatically converting an object of a wrapper class to its corresponding primitive type is known as unboxing. For example – conversion of Integer to int, Long to long, Double to double etc.
    ServersBase.Com- sales@serversbase.com
    █ SSD cPanel Web Hosting • LiteSpeed • MariaDB • CloudLinux & MultiPHP!
    Solutions Tailored To Your Requirements For Unbeatable Agility.
    █ Fully Managed Cloud Instances, Daily Backups & Active Monitoring!

  9. #9
    Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

  10. #10
    Member
    Join Date
    May 2019
    Posts
    95
    Autoboxing is the programmed change that the Java compiler makes between the crude sorts and their comparing object wrapper classes. For instance, changing over an int to an Integer, a double to a Double, etc. On the off chance that the conversion goes the other way, this is called unboxing.

  11. #11
    Registered User
    Join Date
    Dec 2016
    Location
    Mumbai
    Posts
    165
    Thanks for the great post.

  12. #12
    Registered User Lukedawn's Avatar
    Join Date
    Apr 2019
    Location
    Germany
    Posts
    245
    Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes, If the conversion goes the other way, this is called unboxing.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.