| Author |
package and import doubt
|
adam Lui
Ranch Hand
Joined: Sep 03, 2007
Posts: 186
|
|
i got the class files in the same directory course: a.java Student the compiler complaints on a.java about not being able to find Student. i really dont have a clue why.. pls help! (even i put course.Student instead of Student in declaration)
|
boolean b = true;<br />System.out.println ("I believe in Java.<br />Java will make my dream come " + b);
|
 |
Kinnaree Patel
Ranch Hand
Joined: Oct 30, 2007
Posts: 33
|
|
I tried running the code you have wrote and this code is working fine on my machine. It displays the result 20 as expected. [ November 14, 2007: Message edited by: Kinnaree Patel ]
|
95% people read history, 5% create it... On The Way To 5%...
SCJP 5.0 -> 88%, SCWCD -> 86%, Next -> SCBCD and SCDJWS
|
 |
adam Lui
Ranch Hand
Joined: Sep 03, 2007
Posts: 186
|
|
|
is there any system settings or classpath invocation on the command has to be specified to run this code?
|
 |
Kinnaree Patel
Ranch Hand
Joined: Oct 30, 2007
Posts: 33
|
|
Originally posted by adam Lui: is there any system settings or classpath invocation on the command has to be specified to run this code?
No.. I didn't do anything extra to run the program except for setting the classpath for jdk... I just gave the normal commands as we do to compile and run any java file in general. javac -d . Student.java and javac -d . a.java and to run java course.a Thats all. No extra commands. P.S I put "-d ." because my java files were not in course directory. [ November 14, 2007: Message edited by: Kinnaree Patel ]
|
 |
satabdi das
Greenhorn
Joined: Jul 17, 2007
Posts: 28
|
|
Hi, there are no problem with your program. It's an issue with your classpath setting. I have created a directoty under Practice. So I executed the program like this. java -classpath /Practice/ course.Student it worked. You need to set your classpath option accordingly. Hope I helped. Regards, Satabdi
|
 |
 |
|
|
subject: package and import doubt
|
|
|