Wednesday, October 22, 2003 05:28 AM
You are starting out right. Just the devil is in the details.
You do want to nest array lists. But since the return of a "get(int index)" is an Object, you have to cast it to an ArrayList before you can access the arraylist. Here's how to do it.
Note that I casted "a2" as an ArrayList, then wrapped the entire thing in parens... then accessed the method on it.
The compiler (and most IDE's like Eclipse, JBuilder, Forte or NetBeans will recognize this structure for code completion) is smart enough to figure out what you are wanting to do.