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

Which is better stringbuilder or stringbuffer?

867


why Java does not support multiple inheritances?

1113


What is unicode datatype?

919


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

1807


Does every java program need a main?

937


What is linked hashmap and its features?

970


What an i/o filter?

944


What is difference between equals and hashcode method?

1042


What is the benefit of abstract class?

891


What is the maximum size of arraylist in java?

939


What is meant by overloading?

1003


Can we restart a dead thread in java?

928


What does string intern() method do?

1035


What is a boolean flag in java?

955


Can you extend singleton class?

1034