Java (and all other object-oriented languages) provides a mechanism that allows classes to share common features called ____________ and an other mechanism for that allows classes to override shared features called ____________.
The constructor or other method for a superclass can be invoked with the ____________ keyword.
Instance variables and methods that are only to be shared from super-class to sub-classes cannot be declared as public. They must be declared as ____________.
Redefining an inherited method in a subclass is called ____________ the method.
Write declarations for two classes named Parent
and Child
where Child
is a concrete sub-class of Parent
. Add one method declaration to one
of these classes for a method named getName()
. Add this method so that it is defined
in both of the classes. It should return the string literal "this is my name."
.