Skip to Main Content

New to Java

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!

SavitchIn not found? Need help on first program

843785Aug 1 2008 — edited Aug 3 2008
I am using an old Java programming book written by Walter Savitch. I am running a sample program from the book in my NetBeans environment. When I run the thing, it gives me errors on the command SavitchIn. Here is the code:

package firstprogram;

/**
*
* @author mac173
*/
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hello out there.");
System.out.println("Want to talk some more?");
System.out.println("Answer y for yes and n for no.");

char answerLetter;
answerLetter = SavitchIn.readLineNonwhiteChar();
if (answerLetter == 'y')
System.out.println("Nice weather we are having, huh?");

System.out.println("Good-by.");

System.out.println("Press any key to end program");
String junk;
junk = SavitchIn.readLine();
}

}

The error messages from Netbeans:

Compiling 1 source file to C:\Users\mac173\Documents\NetBeansProjects\FirstProgram\build\classes
C:\Users\mac173\Documents\NetBeansProjects\FirstProgram\src\firstprogram\Main.java:23: cannot find symbol
symbol : variable Savitchin
location: class firstprogram.Main
answerLetter = Savitchin.readLineNonwhiteChar();
C:\Users\mac173\Documents\NetBeansProjects\FirstProgram\src\firstprogram\Main.java:31: cannot find symbol
symbol : variable Savitchin
location: class firstprogram.Main
junk = Savitchin.readLine();
2 errors
BUILD FAILED (total time: 0 seconds)

The book describes SavitchIn as a class to obtain input from the keyboard. I assume the class name and the writers names are the same because the wrote the class. Is this class now obsolete, or did I mess up the code?

Edited by: mac173 on Aug 1, 2008 7:12 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2008
Added on Aug 1 2008
12 comments
460 views