• Post Reply Bookmark Topic Watch Topic
  • New Topic

abstract class hierarchy. "cannot find symbol"  RSS feed

 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an abstract class MyShape and its subclass MyLine. When I compile MyLine following error message appears: cannot find symbol Class MyShape.
Unable to figure out what's causing compilation error
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Difficult to see an obvious cause, but you have a minor error and a major error.

You are importing packages you aren't using (eg java.math).
You are nowhere calling the superclass constructor.

You may need to use the set methods in the subclass constructor because you can't get direct access to the fields.
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I copied 2 simple programs and tried to compile. AbstractClass1 compiled. ConcreteClass gave a compilation error: cannot find symbol symbol: class AbstractClass1
Does anybody know what's happening here?
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.

I can't see what's wrong with that lost posting. And it compiled all right when I tried it.
 
michael tall
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It turned out to be a classpath issue. My classpath was . I moved the dot from the end of the classpath to the beginning. It solved the problem. Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!