Date: Tue, 9 Oct 2001 01:57:27 -0400 From: David Banning <david@skytrackercanada.com> To: questions@freebsd.org Subject: java newbie question Message-ID: <20011009015727.A18835@sympatico.ca>
index | next in thread | raw e-mail
I am starting out running jdk 1.3.1.01 and I am utilizing Walter Savitch's
book on Java.
While my "Hello World" program compiles & runs fine, the first example in his
book utilizes a required class file. (SavitchIn.java)
The first tutorial, FirstProgram.java, calls class "SavitchIn"
and method "readLineNonwhiteChar", but I get the error;
bash-2.03$ javac FirstProgram.java
FirstProgram.java:10: cannot resolve symbol
symbol : variable SavitchIn
location: class FirstProgram
answerLetter = SavitchIn.readLineNonwhiteChar();
It seems it cannot find the class file SavitchIn. I thought that
could be handled by setting the CLASSPATH variable, but I have
tried several settings with no change in result. Walter's book does
not cover this, and neither does the Java tutorial I have found
for starting with Sun java.
I have an idea that the answer here is a simple one...
The program follows; (the problem wouldn't be the ^M's would it?)
public class FirstProgram^M
{^M
public static void main(String[] args)^M
{^M
System.out.println("Hello out there.");^M
System.out.println("Want to talk some more?");^M
System.out.println("Answer y for yes or n for no.");^M
^M
char answerLetter;^M
answerLetter = SavitchIn.readLineNonwhiteChar();^M
if (answerLetter == 'y')^M
System.out.println("Nice weather we are having.");^M
^M
System.out.println("Good-bye.");^M
^M
System.out.println("Press enter key to end program.");^M
String junk;^M
junk = SavitchIn.readLine();^M
}^M
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011009015727.A18835>
