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 singleton class example?

591


What is console based application in java?

548


23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an tag?. code,height & width. 26. What does 'CODEBASE' in an applet tag specify?. Files absolute path.

2063


What is the best way to findout the time/memory consuming process?

560


What is the purpose of the enableevents() method?

587






Is string thread safe in java?

587


Java is Pass by Value or Pass by Reference?

622


Why do we need autoboxing in java?

524


What is mnemonic code?

543


Write a function to print Fibonacci series and Tribonacci series?

764


Why is java not 100% pure oops?

626


Is it possible to compare various strings with the help of == operator?

552


What is space character in java?

580


What is the difference between jdk and jre?

614


What is the difference between applet and application?

552