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);
}
}
There is more code after, but there are no errors there, so I'm not gonna include it. Anyway, the line that says "lotteryNumbers[counter] = nextInt(int 10);" get a ".class expected" error.
Java already knows the type of the method parameter; you don't need to specify it when you call the method.
nextInt(int 10);
Should be:
nextInt(10);
This is assuming, of course, that you actually have a method nextInt
defined. (I don't see it in your code sample)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With