Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An ArrayList of Arraylist of...

 
Micah Pezdirtz
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would change mainbox to this.

 
Micah Pezdirtz
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic