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期望」的錯誤。Java「.class expected」
問題解決。 Thx爲快速響應 – Chris 2012-04-09 23:00:10