main class:
public class ECONAPP2 { static Scanner input= new Scanner(System.in); static int score = 0; static ArrayList used
n represents the parameter of the Random#nextInt(int n) method. The parameter must be a positive integer. In your example, the size of the array could be 0, thus resulting in the exception.
n
0