May 2019
Beginner
528 pages
29h 51m
English
Often, an object of one class is an object of another class as well. For example, a CarLoan is a Loan as are HomeImprovementLoans and MortgageLoans. Class CarLoan can be said to inherit from class Loan. In this context, class Loan is a base class, and class CarLoan is a subclass. A CarLoan is a specific type of Loan, but it’s incorrect to claim that every Loan is a CarLoan—the Loan could be any type of loan. The following table lists several simple examples of base classes and subclasses—base classes tend to be “more general” and subclasses “more specific”:

Because every ...
Read now
Unlock full access