Parsing an ArrayList within an ArrayList not working.
Question: I'm new to Java and I'm trying to learn how to parse through an ArrayList
within an ArrayList and I can't quite figure it out. I'm used to Python where
all you had to do was `list[index][index]`. Why am I getting an error reading
`Exception in thread "main" java.lang.RuntimeException: Uncompilable source
code - Erroneous tree type: <any>` when trying to use
`list.get(index).get(index)`? Is this not the proper syntax?

    
    
        import java.io.*;
        import java.util.*; 
        public class Practice {
            public static void main(String[] args){
                ArrayList list = new ArrayList(Arrays.asList(new Integer[]{1,2,3,4,5,6,7,8,9,10})); 
                ArrayList list1 = new ArrayList(Arrays.asList(new Integer[]{1,2,3,4,5,6,7,8,9,10})); 
                list.add(list1); 
                System.out.println(list.get(10).get(0));
    
            }
    
        }
    


Answer: Java and Python are quite different when it comes to types: [Java Types vs
Python Types](http://www.programcreek.com/2012/09/java-vs-python-data-types/)

Java requires explicit type declarations and is very strict on how types are
used. For example, you need to explicitly specify what type of ArrayLists you
are using.

Assuming that you wanted to create 2 ArrayLists, outerList that contains
innerLists that each contain the numbers 1-10, this is Java code will do the
trick:

    
    
    import java.io.*;
    import java.util.*; 
    public class Practice {
        public static void main(String[] args) {
             ArrayList<Integer> innerList = new ArrayList<Integer>(Arrays.asList(new Integer[]{1,2,3,4,5,6,7,8,9,10}));
             ArrayList<ArrayList<Integer>> outerList = new ArrayList<ArrayList<Integer>>(); 
             for (int i = 0; i < 10; i++) {
                 outerList.add(innerList); 
             } 
             System.out.println(outerList.get(9).get(0));
        }
    }
    

