Results 1 to 2 of 2
  1. #1
    pascal45 is offline Member
    Join Date
    Dec 2007
    Posts
    1
    Rep Power
    0

    Default Regarding Scanner Object -- Cannot Resolve the Symbol

    Hi,

    I am new to Java, as well as this Forum.

    Today I tried with Scanner object. But it shows Error.

    My Code:

    import java.util.Scanner;

    public class CourseGradeBookTest
    {
    public static void main(String args[])
    {
    Scanner input=new Scanner(System.in);
    CourseGradeBook CGB=new CourseGradeBook();
    System.out.println("Course Grade Book");
    String NameofCourse=input.nextLine();
    System.out.println();
    CGB.displayMessage(NameofCourse);
    }
    }


    Errors:

    CourseGradeBookTest.java:1: cannot resolve symbol
    symbol : class Scanner
    location: package util
    import java.util.Scanner;
    ^
    CourseGradeBookTest.java:7: cannot resolve symbol
    symbol : class Scanner
    location: class CourseGradeBookTest
    Scanner input=new Scanner(System.in);
    ^
    CourseGradeBookTest.java:7: cannot resolve symbol
    symbol : class Scanner
    location: class CourseGradeBookTest
    Scanner input=new Scanner(System.in);
    ^
    3 errors


    I went through the Previous Questions which were related to My Question. I checked with My Java Version..its java version "1.6.0_02"

    Can You please help Me to get out of this problem.

    Regards

    Rajan.

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Are you sure you don't mean CourseGradeBookTest instead of CourseGradeBook ?

    And for now, since I'm not sure what you're trying to completely do, I commented out the line:
    Java Code:
    CGB.displayMessage(NameofCourse);
    and as a result it compiled and ran. Or you can make your own display() or find one.

    -Capt

Similar Threads

  1. Replies: 2
    Last Post: 09-18-2008, 07:30 AM
  2. Cannot Resolve Symbol error...
    By seral1969 in forum New To Java
    Replies: 4
    Last Post: 02-18-2008, 12:17 AM
  3. Error: cannot resolve symbol, help me
    By mathias in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 08-06-2007, 02:46 PM
  4. MySite/Valid.java:56: cannot resolve symbol
    By Albert in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 07-05-2007, 05:49 AM
  5. myfaces.apache.org/extensions can't resolve
    By Heather in forum JavaServer Faces (JSF)
    Replies: 2
    Last Post: 06-30-2007, 04:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •