View Single Post
  #3 (permalink)  
Old 07-31-2007, 09:33 AM
Bench Bench is offline
Full Programmer
Join Date: Jul 2007
Location: UK
Posts: 113
iTrader: (0)
Bench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished roadBench is on a distinguished road
As far as I know, its the same sort of thing in Java as in C++ - in which case, you need to specify types between the angular brackets
Code:
         ArrayList< ArrayList<String> > my_2dlist = 
                new ArrayList< ArrayList<String> >();
         
         my_2dlist.add( new ArrayList<String>() );
         my_2dlist.get(0).add("Hello, World");
         System.out.println(my_2dlist.get(0).get(0));

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to Bench For This Useful Post:
HelloWorld (07-31-2007)