Re: Cannot resolve symbol class Scanner



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");

}

}

}

}




.



Relevant Pages

  • Re: Cannot resolve symbol class Scanner
    ... it was my path statement. ... If you download and install jdk1.5.0_08 you will have them both. ... Maybe I do not have the latest API classes. ... cannot resolve this symbol Scanner. ...
    (comp.lang.java.help)
  • Re: Cannot resolve symbol class Scanner
    ... If you download and install jdk1.5.0_08 you will have them both. ... Maybe I do not have the latest API classes. ... cannot resolve this symbol Scanner. ...
    (comp.lang.java.help)
  • Re: Outlook 2007 Mail Rendering Problem
    ... Some were scanned upon download, but most were already downloaded and were ... AVG is the one that needs to work on THEIR program for compatibility, ... scanned upon opening and you cannot send a virus if your real-time scanner ... Milly Staples [MVP - Outlook] ...
    (microsoft.public.office.misc)
  • Re: Possible Virus; Need Xp Gurus Help
    ... missing from Norton. ... opinion" av scanner). ... Please download, install and update the following software... ... I suggest scanning the system in Safe Mode. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: TFTP
    ... There are anti virus News Groups specifically for this type of discussion. ... Stinger is an "On Demand" AV scanner that only targets ~54 infectors, ... This will bring up the initial menu of choices and should be executed in Normal Mode. ... You can choose to go to each menu item and just download the needed files or you can ...
    (microsoft.public.windowsxp.security_admin)