aspose file tools*
The moose likes Beginning Java and the fly likes Can't resolve symbol in inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Watch "Can New topic
Author

Can't resolve symbol in inheritance

Dan Taylor
Greenhorn

Joined: Apr 16, 2004
Posts: 10
OK
I don't understand why I get a can't resolve symbol on my constructors.
Here is the basics of my code
3 classes -
1st class 'A' is abstract
has a default empty constructor and a constructor with A's attributes
ex:
public A( int getX )
{ this.x = getX; }

2nd class B extends A
and has default empty constructor (with a call to super()) and a constructor that calls A's constructor and adds B's attributes
ex:
public B( int getX, int getY)
{
super( getX );
this.y = getY;
}
OK so far so good, these files with their attributes and methods compile.
Now I add class 'C'.
I follow the same format as above creating 2 constructors, a default calling super(); and another that takes the B constructor and adds C's attributes.
When I try to compile I get the following error:

I also get this error on the second constructor. I don't understand why this is happening. Any help would be appreciated.
Thanks
Dan
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
post your code so we can get the whole picture.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Check your definition of the no-argument constructor. Did you accidentally give it a return value, making it into an ordinary method?


[Jess in Action][AskingGoodQuestions]
Dan Taylor
Greenhorn

Joined: Apr 16, 2004
Posts: 10
OK the classes A and B were defined by my teacher. They are actually classes Person and Employee. Someone else has posted in this forum from my class so I wanted to avoid posting code. The class I defined is SalesEmployee.
Below is the Person class (the comments are from the teacher to the class):

Here is the teacher defined Employee class with her comments:

Lastly this is my code for SalesEmployee class:


Thanks all
Dan Taylor
Greenhorn

Joined: Apr 16, 2004
Posts: 10
Any takers on this one? Please??
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
i try the code, it seems ok to me except the
Company variable was rejected by compiler.
Gary Down
Ranch Hand

Joined: Apr 09, 2004
Posts: 46
Likewise,
I had no problems compiling your code.. had to create a dummy "Company" class.
Suggest you ensure that the .class files are in sync with your .java files
try compiling them again from the top down i.e. person first
Good luck.
Gary.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't resolve symbol in inheritance
 
Similar Threads
Pixels on applets
Bacis constructor doubt
Help on testprogram and subclass please
super().this()!
Constructor