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
Where are variables stored?
What is the platform?
Can we have any code between try and catch blocks?
what is daemon thread and which method is used to create the daemon thread? : Java thread
What are the main uses of this keyword?
What is a method signature java?
What is the synchronized method modifier?
Write a program to search a number in the given list of numbers.
What is a values collection view ?
How can you write a loop indefinitely in java programming?
Explain what pure virtual function is?
Is char * a string?
Difference between object instantiation and construction ?
Which list does not allow duplicates in java?
What are access specifiers in java ?