February 2017
Beginner
1056 pages
28h 57m
English
What’s in a name? That which we call a rose
By any other name would smell as sweet.
—WILLIAM SHAKESPEARE, Romeo and Juliet
Inheritance allows you to define a base class and derive classes from the base class. Polymorphism allows you to make changes in the method definition for the derived classes and have those changes apply to the methods written in the base class. This all happens automatically in Java, but it is important to understand the process.
Consider a program that uses the Person, Student, and Undergraduate classes as depicted in Figure 8.4. Let’s say that we ...
Read now
Unlock full access