Create a file List.java and copy the following code into it:
import java.util.ArrayList;
import java.lang.Integer;
public class Main {
public static void main(String[] args) {
ArrayList<Integer> nums = new ArrayList<Integer>();
for (int i = 0; i < 5; i++) {
nums.add(i);
}
System.out.println(nums.get(5));
}
}
The java.lang.IndexOutOfBoundsException: Index: 5, Size: 5 error occurs when running the code. In which line of code does this error occur?