ArrayList<Integer> as = new ArrayList(Arrays.asList("India", "Australia", "South Africa"));
The above mentioned line compiles fine. I am declaring a variable of array list of type Integer, But it stores string values also. I am expecting a compilation error here. Could someone help me please?