Answer Posted / srinu
auto boxing:-
The process of conversion of primitive data type into wraper
class object into AUTOMATICALLY is called Auto boxing.
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.
EX:
HashSet<Integer> hs=new HashSet<Integer>();
hs.add(1);
hs.add(2);
Iterator it=hs.iterator();
while(it.hasNext())
{
System.out.println(it.next());
}
(Note: original it.next() returns object but here
System.out.println print primitive datatypes.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are generic methods?
What is the difference between break and continue statements?
What do you understand by looping in java? Explain the different types of loops.
Difference between linkedlist and arraylist.
Can we execute a program without main?
What is the size of boolean variable?
What is JVM and is it platform independent?
What are void pointers?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
What is busy spin, and why should you use it?
What is the final class?
How do you start a thread?
When will we use them?
What is an infinite loop? How infinite loop is declared?
How do you find the absolute value?