my dog learned polymorphism*
The moose likes Beginning Java and the fly likes I MUST BE STUPID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I MUST BE STUPID" Watch "I MUST BE STUPID" New topic
Author

I MUST BE STUPID

Dave Van Even
Ranch Hand

Joined: Jul 19, 2001
Posts: 101
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
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
If I put them in the same package, I get the same result
Dave
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
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
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
I forgot to put . in my classpath
thanks for helping out!

Dave
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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
YEAH to Cindy!!! Gosh, plenty of nice people here in JavaRanch huh?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

and I'd finish up with "Hands up anyone who hasn't made this mistake"

Dave.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I MUST BE STUPID
 
Similar Threads
interface
Why interface does not allow to reference a variable in super class using super keywo
anonymous class giving compile time error
problem with monitors :
Referenec passing