First Program???

frank3usc

Junior Member
Jan 16, 2003
16
0
0
Ok, I am trying to write a program for one of my classes. I tried mine and it didn't work and then I tried what was in the book and copied straight out the book and it still didn't work.
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 or n for no.");

char answerLetter;
answerLetter = SavitchIn.readLineNonwhiteChar();
if (answerLetter == 'y')
System.out.println("Nice weather we are having.");
System.out.println("Good-bye.");

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


}
} // firstprogram
That is the program and here is the problem it gives me when I go to compile it.
CompileServer output:

c:/emacs-21.2/bin/firstprogram.java
c:/emacs-21.2/bin/firstprogram.java:22: cannot resolve symbol
symbol : variable SavitchIn
location: class firstprogram
answerLetter = SavitchIn.readLineNonwhiteChar();
^
c:/emacs-21.2/bin/firstprogram.java:29: cannot resolve symbol
symbol : variable SavitchIn
location: class firstprogram
junk = SavitchIn.readLine();
^
2 errors

Compilation exited abnormally with code 1 at Mon Jan 20 22:54:14


Thanks
 

ROTC1983

Diamond Member
Oct 2, 2002
6,130
0
71
I am having trouble with mine too and I posted here...hopefully someone can help us :)
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: frank3usc
How would I go about that? I am new to this soo......:(

SavitchIn nameYouWantForYourObject = new SavitchIn();

answerLetter = nameYouWantForYourObject.readLineNonwhiteChar();