Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

can anyone explain me the concept of autoboxing?

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


Please Help Members By Posting Answers For Below Questions

What is the internal implementation of set in java?

911


Write a program to check string is palindrome without using loop?

1018


How do I get 64 bit java?

1076


How an object is serialized in java?

972


What is the final keyword?

969


Can we change the value of static variable?

940


What is length in java?

1003


What is the default value of the local variables?

1001


What is annotation in java?

1031


What is the declaration statement?

924


Which collection allows duplicate values in java?

955


What does string [] args mean?

994


Write a program to find maximum and minimum number in array?

979


What are some alternatives to inheritance?

1079


What is Hierarchy of exception?

1068