Is it possible to do this in Java? Maybe I'm using the wrong syntax?
ArrayList<Integer> iAL = new ArrayList<Integer>();
iAL.addAll(Arrays.asList(new Integer[] {1, 2, 3, 4, 5 }));
for (int i = 0; i < iAL.size(); ++i) {
System.out.println(iAL[i]); //<-------- HERE IS THE PROBLEM
}
Also, is it possible to do something like
iAL.addAll( new int[] {1, 2, 3, 4, 5} );
as is seen on c#?
Thanks