Cannot resolve symbol class Scanner
- From: "Roy Gourgi" <royng@xxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 14:30:44 -0400
Hi,
I am trying to compile this program but I get the error message that it
cannot resolve this symbol Scanner. I downloaded the JDK6 and in my PATH
statement I put C:\Program Files\Java\jdk1.6.0\bin. The code is below. What
am I doing wrong.
TIA
Roy
import java.util.Scanner;
public class GetInteger
{
static Scanner sc = new Scanner(System.in);
public static void main(String[] args)
{
System.out.print("Enter an integer: ");
int i = GetInteger();
System.out.println("You entered "+i);
}
public static int GetInteger()
{
while (true)
{
try
{
return sc.nextInt();
}
catch (InputMismatchException e)
{
sc.next();
System.out.print("Thast not an integer. " + "try again");
}
}
}
}
.
- Follow-Ups:
- Re: Cannot resolve symbol class Scanner
- From: Roy Gourgi
- Re: Cannot resolve symbol class Scanner
- From: Oliver Wong
- Re: Cannot resolve symbol class Scanner
- Prev by Date: Re: Convert from int to char
- Next by Date: Re: Cannot resolve symbol class Scanner
- Previous by thread: jboss 3.2.5 and eclipse 3.2 wtp 1.5
- Next by thread: Re: Cannot resolve symbol class Scanner
- Index(es):