This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes problem with inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem with inheritance" Watch "problem with inheritance" New topic
Author

problem with inheritance

Tony Matthes
Greenhorn

Joined: Nov 16, 2003
Posts: 3
Hi,
I don't think this is really a beginner question, but i could be forgetting something very simple!
I have two classes, LevelCharacter (a superclass) and Policeman (a sub class of LevelCharacter), the problem i have is this:
i can compile LevelCharacter no problem, but when i compile Policeman i get this error:

symbol : class LevelCharacter
location: class Policeman
class Policeman extends LevelCharacter
^
1 error

why am i getting this error? they files are in the same folder and i don't see any other problems!!!
HELP!
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
just a wild guess, do you declare LevelCharacter final ?
what is the error mesg ?
Tony Matthes
Greenhorn

Joined: Nov 16, 2003
Posts: 3
Sorry i thought i had the error included, the error is
cannot resolve symbol
symbol : class LevelCharacter
location: class Policeman
class Policeman extends LevelCharacter

and no i don't have it declared as final.
the Policeman class is as follows

[ November 16, 2003: Message edited by: Tony Matthes ]
Chris Allen
Ranch Hand

Joined: Feb 01, 2003
Posts: 127
Can you post the LevelCharacter code as well? I think it might shed some light on the problem.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Two questions:
1). Is you CLASSPATH set up correctly?
2). Are you classes located in your CLASSPATH (be sure to include the proper directory structure if using packages)?
Answering both of these questions will ususlly solve the problem that you describe. The only other suggestion is to make sure that everything is spelled correctly


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156

Tony
can U give the complete program


santhosh<br />SCJP,SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with inheritance
 
Similar Threads
Only fun forwards for fun ...
who owns you [political]
How works the classpath
why won't this compile?
no argument constructor