what is auto boxing

Answer Posted / vijay, hangar17

Auto boxing is introduced in jdk1.5
Automatic conversion from int to Integer is Auto boxing and
automatic conversion back from Integer to int is auto unboxing.

For example

int i;
Integer a

//Manual conversion

i = a.intValue();
a = new Integer(i);

By Auto boxing

i=a;
a=i;

Is This Answer Correct ?    43 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are encapsulation, inheritance and polymorphism?

521


Difference between start() and run() method of thread class?

582


What do you mean by static variable?

564


Is java platform independent?

561


What is java in layman terms?

521






What is the structure of java?

500


What is the use of parseint in java?

527


What is boolean false?

516


What is class variable java?

578


Why local variables are stored in stack?

486


What is a default method?

511


What are the 4 types of characters?

535


What are the 2 types of java programs?

558


How to use string tokenizer class.

610


What if I write static public void instead of public static void in java?

572