Re: Cannot resolve symbol class Scanner
- From: Petterson Mikael <mikael.petterson@xxxxxxxxxxxxxxx>
- Date: Thu, 28 Sep 2006 09:40:20 +0200
Hi,
Do 'java -version'
Besides can you post the error message.
cheers,
//mikael
Roy Gourgi wrote:
Hi Oliver,.
Maybe I do not have the latest API classes. I think that for Scanner and the InputMatchingException you need the 1.5 API. Where can I download just the API classes?
Thanks
Roy
"Roy Gourgi" <royng@xxxxxxxxxxxx> wrote in message news:urzSg.100429$LH3.994898@xxxxxxxxxxxxxxxxxxxxxx
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
- References:
- Cannot resolve symbol class Scanner
- From: Roy Gourgi
- Re: Cannot resolve symbol class Scanner
- From: Roy Gourgi
- Cannot resolve symbol class Scanner
- Prev by Date: Re: Import Map.class wrong version error
- Next by Date: Re: SAXException: Attribute "xmlns:env" was already specified ...
- Previous by thread: Re: Cannot resolve symbol class Scanner
- Next by thread: Re: Cannot resolve symbol class Scanner
- Index(es):