View Single Post
  #4 (permalink)  
Old 07-31-2007, 09:45 AM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
Quote:
Originally Posted by Bench View Post
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));
Thanx for the code Bench
I'll try your way out since the code that you provided is much more make sense than what I currently have
Indeed the one that I have is working, but I'm just thinking for the code readability for my future reference

__________________
PHP Code:
System.out.println("Hello World!"); 

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