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 the steps in the jdbc connection?
What is Mutex (Mutual Exclusion Object) ?
What is difference between wait and notify in java?
Can we declare a static variable inside a method?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What are heap memory and stack memory and what are memory tables.
Are arrays static in java?
What is purpose of keyword void?
How are variables stored in memory?
What is a class component?
What is an empty string in css?
When should we create our own custom exception classes?
What is difference between final and immutable?
What is the difference between conversation & casting?
What do you mean by object?