Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Regarding Scanner Object -- Cannot Resolve the Symbol

807603Dec 18 2007 — edited Dec 19 2007
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2008
Added on Dec 18 2007
2 comments
123 views