aspose file tools*
The moose likes Beginning Java and the fly likes An ArrayList of Arraylist of... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "An ArrayList of Arraylist of..." Watch "An ArrayList of Arraylist of..." New topic
Author

An ArrayList of Arraylist of...

Micah Pezdirtz
Greenhorn

Joined: Aug 14, 2006
Posts: 25
if i had:

ArrayList<ArrayList> mainBox;
ArrayList<Crayons> crayonBox1;
ArrayList<Crayons> crayonBox2;
ArrayList<Crayons> crayonBox3;

and then proceeded to add each crayonBox to the mainBox, would there be any loss of...whats it called i mean that the mainBox, being an ArrayList of ArrayLists, would be ok to hold ArrayLists<crayons>? i remember before i knew about AraryList<Object> i had to cast and recast things all the time, but would i have to do any of that in this case? i wasnt sure since the main box is ArrayList<ArrayList> and not ArrayList<ArrayList<crayons>> ??? if that kind of thing is existent or necessary. sorry if this is a lame question
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I would change mainbox to this.

Micah Pezdirtz
Greenhorn

Joined: Aug 14, 2006
Posts: 25
so, that would actually work??? it looks funny, i didnt really expect that to be real
thanks!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: An ArrayList of Arraylist of...