import java.util.Random;
import java.util.Scanner;
public class Lottery
{
private int[] lotteryNumbers = new int[5];
private int counter;
private int[] userNumbers = new int[5];
private Scanner keyboard = new Scanner(System.in);
public Lottery()
{
for(counter = 0; counter < 5; counter++)
{
lotteryNumbers[counter] = nextInt(int 10);
}
}
后面还有更多的代码,但是没有错误,所以我不包含它们。 无论如何,“lotteryNumbers[counter] = nextInt(int 10);”这一行会报一个“class expected”的错误。