| Author |
How List.add(Primitive Value) works in real Life
|
himkar dwivedi
Greenhorn
Joined: Mar 02, 2010
Posts: 5
|
|
Hi I am new for java and wat to know that
int intValue=10;
List aList=new ArrayList();
aList.add(intValue);
This statment is fine for java 5 and giving error for java 4. I need to know how add method convert this primitive to Integer Object
Thanks
|
 |
pawan chopra
Ranch Hand
Joined: Jan 23, 2008
Posts: 361
|
|
|
This will help you Iintroduction-to-autoboxing
|
Pawan Chopra
SCJP - DuMmIeS mInD
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
|
|
Useful link, pawan chopra.
himkar dwivedi, welcome to the Ranch Why are you not parameterising your List?
|
 |
himkar dwivedi
Greenhorn
Joined: Mar 02, 2010
Posts: 5
|
|
|
Thanks, This is very helpful link
|
 |
 |
|
|
subject: How List.add(Primitive Value) works in real Life
|
|
|