Re: Inheritance and lousy Frame
NickName wrote:
....
Thank you all. It is working now with your help. Ok, lessions learned
for me:
a) subclass object must be instantiated from the super class;
I don't even understand this remark.
b) methods in super class need to use final keyword to prevent override
from subclass;
Unless they are designed and intended to be overridden. For example,
java.util.AbstractSet provides a series of default implementations of
methods in the Set interface. Most actual Set implementing classes
extend AbstractSet and override some of the methods.
c) variable name needs to start from a lower case letter.
It is conventional style. The compiler does not care, but human readers
who are used to reading e.g. Sun's Java code will find it easier to read
if you do stick to the conventions.
Now, a new question arises, I'm trying to use abstract method, speed,
in this case.
....
You seem to be attempting to discover the rules of the language, and how
to use it, experimentally.
Have you considered working through a book or tutorial? That would not
just explain the rules, it would explain when and how to use features.
Patricia