[Java]-cannot resolve symbol SavitchIn Please help!!!
I created a program called FirstProgram.java which references the class satvitchin (basically a program to receive data from the keyboard) it can be found here: lander.edu/jdileo/Fall03/CS180/downloads/SavitchIn.java
i have both satvitchin and firstprogram in the same directory, i compile satvichin with no problems then when i try to compile firstprogram i get this error: C:\Documents and Settings\David Walton\Desktop\School\CS 180\FirstProgram.java:10: cannot resolve symbol symbol : variable SavitchIn location: class FirstProgram answerLetter = SavitchIn.readLineNonwhiteChar(); ^ C:\Documents and Settings\David Walton\Desktop\School\CS 180\FirstProgram.java:18: cannot resolve symbol symbol : variable SavitchIn location: class FirstProgram junk = SavitchIn.readLine(); ^ 2 errors Tool completed with exit code 1 ------------------------------------------------------------------------ when i compile at school everything works fine this is the code for firstprogram: public class FirstProgram { 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(); } } ------------------------------------------------------------------------ is it something with the path? java is looking in the wrong directory for the class file it needs? thanks |
Found the answer nevermind
|
/**Friend Try this */
import java.io.*; public class FirstProgram { public static void main(String[] args)throws IOException { 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."); String answerLetter; BufferedReader SavitchIn=new BufferedReader(new InputStreamReader(System.in)); answerLetter = SavitchIn.readLine(); if (answerLetter.equals("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(); } } |
All times are GMT -5. The time now is 04:19 PM. |