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 is the internal implementation of set in java?
Write a program to check string is palindrome without using loop?
How do I get 64 bit java?
How an object is serialized in java?
What is the final keyword?
Can we change the value of static variable?
What is length in java?
What is the default value of the local variables?
What is annotation in java?
What is the declaration statement?
Which collection allows duplicate values in java?
What does string [] args mean?
Write a program to find maximum and minimum number in array?
What are some alternatives to inheritance?
What is Hierarchy of exception?