Home Segments Top Top Previous Next

332: Mainline

Once you have defined an abstract method, Java forces you to define nonabstract methods accessible to all nonabstract subclasses of the abstract class.

For example, because both the Movie class and the Symphony class are subclasses of the Attraction class, both must have rating methods. On the other hand, if the Movie class were to have subclasses, no rating method would be required in those subclasses, because they would inherit the nonabstract rating method from the Movie class.