Friday, April 14, 2017

Java subclasses

A class can inherit from a parent or superclass. This is done in Java with the extends keyword. The following snippets create a ProjectManager subclass from the EmployeeDetails superclass. Note that the subclass invokes code from the superclass using the super keyword. It also overrides the compute salary method.

 View expanded image on
Click image to view expanded image on

No comments:

Post a Comment