Today's lecture was on Chapter 10, Inheritance. It was an example of a test question.
There are two programs for today's class, as well as finishing up the program from last Friday.
There are four files for the first program.
- Driver.java
- Building.java
- Apartment.java
- House.java
There are four files for the second example:
- The Main, this file creates objects of the classes.
- The Mammal class is the super class.
- The Bear class inherits from the Mammal class, and
- The Whale class inherits from the Mammal Class.
- Some of the topics covered in the code were creating a method final.
- Private, public, and protected methods and variables
- Overwriting a method from the base class
- super
- and other general rules of inheritance. It also includes a review of a static variable.
|