can anyone explain me the concept of autoboxing?

Answer Posted / jitu

In case of autoboxing directly the value of the constructor
assign to a variable.i.e object of wrapper class directly
assign to a variable.but it is only possible in case of 1.5
version.
Ex:public class X
{public static void main(String a[])
{Integer i1=new Integer("20");
Integer i2=new Integer("20");
int m1=i1;
int m2=i2;
S.o.p(m1+m2);o/p-20

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is one third plus one third as a fraction?

483


Is singleton a bad practice?

573


If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

589


What is a line separator in java?

533


What is http client in java?

515






Compare overloading and overriding?

557


What is the class in java?

552


What is difference between array and vector?

529


What is difference between add() and addelement() in vector?

1058


Is array an object in java?

545


What are instance variables?

602


Is java still relevant?

494


What do you understand by an io stream?

577


What is :: operator in java 8?

552


Can you add null to a list java?

580