how comes this doesn't work ?? DrawStrategy.java compiles fine � Base.java
produces an error on compile: cannot resolve symbol DrawStrategy (files are in the same directory) I MUST BE STUPID not to see my mistake [This message has been edited by Dave Van Even (edited October 17, 2001).]
Wilfried LAURENT
Ranch Hand
Joined: Jul 13, 2001
Posts: 269
posted
0
Being in the same directory is to my opinion not enough. Do they belong to the same package? W.
Dave Van Even
Ranch Hand
Joined: Jul 19, 2001
Posts: 101
posted
0
If I put them in the same package, I get the same result Dave
Wilfried LAURENT
Ranch Hand
Joined: Jul 13, 2001
Posts: 269
posted
0
Do you use an IDE or do it "by hand"? Where is the .class file generated? Check that if you compile them separetely, the directory where your outputs are generated has to be in your classpath. W. [This message has been edited by Wilfried LAURENT (edited October 17, 2001).] [This message has been edited by Wilfried LAURENT (edited October 17, 2001).]
shilpa kulkarni
Ranch Hand
Joined: Jun 07, 2000
Posts: 87
posted
0
It compiles and runs fine for me, output is - Dit is strategy "Dit is strategy" I have just put all classes in one folder, no package. I put them in seperate files, so i have 4 java files and 4 class files.
Dave Van Even
Ranch Hand
Joined: Jul 19, 2001
Posts: 101
posted
0
I forgot to put . in my classpath thanks for helping out!
Dave
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
0
Dave, Dave, Dave, You KNOW that there is no such thing as a STUPID question (Cindy slowly shakes head). We have ALL overlooked little things that hang us up. I personally take objection to you calling someone stupid that is smart enough to figure out his own mistake - and I think that you owe him an apology .
"JavaRanch, where the deer and the Certified play" - David O'Meara
Margaret Tan
Greenhorn
Joined: Sep 14, 2001
Posts: 20
posted
0
YEAH to Cindy!!! Gosh, plenty of nice people here in JavaRanch huh?