CS 160



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.
  1. Driver.java
  2. Building.java
  3. Apartment.java
  4. House.java

There are four files for the second example:
  1. The Main, this file creates objects of the classes.
  2. The Mammal class is the super class.
  3. The Bear class inherits from the Mammal class, and
  4. 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.