October 2017
Beginner
318 pages
7h 26m
English
Our Literature class contains the declarations and all of the functionality needed to manage a piece of literature's title and author. If we let Java know that there is an inheritance relationship between Poem and Literature, we should be able to remove all the real references from the title and author of the following Poem class:
package inheritance;public class Poem extends Literature{ private String title; private String author; private String style;
First, let's talk about the declaration of the Poem class that we've modified. When we say that one class extends another, we're saying that there is an is-a relationship between them such that I can logically make the statement, "A poem is a piece of literature." In ...
Read now
Unlock full access