What is the output for the below code ? public class Test { public static void main(String... args) { ArrayList list = new ArrayList(); list.add(1); list.add(2); list.add(3); for(int i:list) System.out.println(i); } }
1 2 3
Compile error , can't add primitive type in ArrayList
Compile error on for(int i:list) , Incorrect Syntax
0 0 0