• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with inheritance

 
Tony Matthes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a wild guess, do you declare LevelCharacter final ?
what is the error mesg ?
 
Tony Matthes
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the LevelCharacter code as well? I think it might shed some light on the problem.
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
santhoshkumar samala
Ranch Hand
Posts: 156
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony
can U give the complete program
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic