I am trying to run the following code that I found marked as correct on StackOverflow:
List<Integer> intList = new ArrayList<Integer>();
for (int index = 0; index < ints.length; index++)
{
intList.add(ints[index]);
}
When I run the code I get an error: Syntax error on token ";", { expected after this token on the line starting with List
Is there something I am missing?