G Guest Dec 18, 2005 #1 Hi , Is it possible to define a two dimensional arraylist ? if so how? Many Thanks
G Guest Dec 18, 2005 #2 Hi, nope, not natively like arrays, but you could have an arraylist of arraylist if you want which simulates a 2D array i.e. ArrayList list = new ArrayList(); for(int i=0; i<10; i++) { list = new ArrayList(); } Now you can access the arraylist like a 2D object i.e. object x = list[x][y]; Hope that helps Mark Dawson http://www.markdawson.org
Hi, nope, not natively like arrays, but you could have an arraylist of arraylist if you want which simulates a 2D array i.e. ArrayList list = new ArrayList(); for(int i=0; i<10; i++) { list = new ArrayList(); } Now you can access the arraylist like a 2D object i.e. object x = list[x][y]; Hope that helps Mark Dawson http://www.markdawson.org