can anyone explain me the concept of autoboxing?

Answer Posted / durga ganesh reddy

autoboxing is that the conversion of primitive data types
into wrapper class objects automatically.By using generic
types of java 1.5,we an acheive it easily.By declaring, the
collection classes as shown below we can do it.
HashSet<Integer> hs=new HashSet<Integer>();
hs.add(1);
hs.add(2);
Iterator it=hs.iterator(0;
while(it.hasNext())
System.out.println(it.next());

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a window and a frame in java programming?

587


Can we have any code between try and finally blocks?

556


Can a set contain duplicates?

515


What is the use of predicate in java 8?

488


How does sublist works in java?

538






What is arguments in java?

517


explain the difference between jdk and jvm?

557


Explain the Propertie sof class?

584


What is meant by class loader? How many types are there?

668


Is the empty set a singleton?

537


What is array length in java?

521


Which programming language is most secure?

525


Write a factorial program using recursion in java?

510


What is the difference between object oriented programming language and object based programming language?

552


When should I use a singleton?

553