11. Classes

Interfaces and abstract classes.

Additional resources

Contents


11. Animal

Animal and CarnivoreAnimal.

11. Candy

Food interface, Candy class, ComboCandy subclass.

11. Inheritance 1

Animal. Dog. Cat. Borzoi. Boxer. Abstract example: A, B, C.

11. Inheritance 2

Noisy, Colorable, Cat, RandomCat. Practice with classes, abstract classes, and interfaces.

Abstract Classes

When are abstract classes useful? A discussion of a few examples.

Interfaces

Concrete examples of interfaces.

11. AQuiz IAnswers

A quiz asking you to write an interface, an abstract class, and more.

11. Quiz B

11. Quiz C

11. Inheritance Calls I

Approaching AP MCQ-type problems by thinking about functions.

11. Inheritance Calls II

When a method is overridden, it can be tricky to figure out which method is called. We give an example to show why it is not possible to call the non-overriden method.

11. Treasure Hunt

11. Instanceof

Last modified August 18, 2023: 2022-2023 End State (7352e87)