my dog learned polymorphism*
The moose likes Java in General and the fly likes arraylist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "arraylist" Watch "arraylist" New topic
Author

arraylist

Duray Rajesh
Greenhorn

Joined: Jun 16, 2006
Posts: 12
hi,
i have a doubt in the following program
psvmain()
{
ArrayList a=new ArrayList();
a.add(1);
sop(a);
}
output:1;
how arraylist is accepting value like 1, 1.5.,
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Check out autoboxing - http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
 
Consider Paul's rocket mass heater.
 
subject: arraylist