| The rule that specifies which methods get inherited by
a subclass is similar to that for member variables. |
| |
| Rule: |
| A subclass inherits all of the methods within its
superclass that are accessible to that subclass (unless the
method is overriden by the subclass). |
| |
| |
| That is, subclasses |
| 1. inherit those methods declared as public or protected |
| |
| 2. inherit those methods declared with no access specifier
as long as the subclass is in the same package as the superclass |
| |
| 3. don't inherit a superclass's method if the subclass
declares a method using the same name. The method in the
subclass is said to override the one in the superclass. |
| |
| 4. don't inherit private methods |
| |
| |
| |