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
What variables are stored in stack?
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 thread safe java?
Why is flag used in java?
When should I use singleton?
What is meant by binding in rmi?
What is a boolean expression in java?
What is the use of StringTokenizer class?
Which data type is class in java?
What is a variable declaration?
Difference between ‘>>’ and ‘>>>’ operators in java?
What does it mean that a method or field is “static”?
What is the exact difference in between Unicast and Multicast object? Where will it be used?
What is the purpose of garbage collection in java? When is it used?
What is the meaning of 3 dots in java?