-
Junior Member
what is Autoboxing in java
-
Contributing Member
Re: what is Autoboxing in java
AutoBoxing means Conversion of Primitive to Wrapper Object automatically.
this concept is newly added in java5.0.
-
Junior Member
Re: what is Autoboxing in java
Originally Posted by
pavang
can u tell
As any java programmer knows that we cann't put a primitive values(int,floatetc.) into collection.Collection can hold only object references,so you have to box primitive values into the appropriate wrapper classes( Integer,Float etc.).When you take the object out of the collection, you get the Integer that you put in; if you need an int, you must unbox the Integer using the intValue method. this boxing and unboxing is a pain,and clutters up your code.tHe Autoboxing and Unboxing feature automates the process.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules