(Is class the right term)
here's what i got:
import java.util.Random;
import java.util.Scanner;
public class Decisions
{
public static void main (String[] args)
{
Random generator = new Random();
Scanner scanner;
int value = generator.nextInt(100) + 1;
int guess = 0;
System.out.println("Enter an integer between 1 and 100 (integers 1\n" +
"and 100 are okay too) and press enter:" );
//HERE LIES THE PROBLEM:
guess = scanner.nextInt();
//
}
}
I want the user to be able to type in a number and press enter.
How do i fix the problem line? Please tell me if you need more details.
Thanks.
2006-10-12
18:45:36
·
2 answers
·
asked by
larkale07
2
in
Computers & Internet
➔ Programming & Design
on further review it may be "Scanner scanner;", line 11 that's causing the problem.
2006-10-12
18:56:21 ·
update #1