February 2017
Beginner
1056 pages
28h 57m
English
You do not have to die in order to pass along your inheritance.
—AD FOR AN ESTATE PLANNING SEMINAR
This section presents some basic programming techniques you need when defining or using derived classes.
A derived class, such as the class Student in Listing 8.2, has its own constructors. It does not inherit any constructors from the base class. A base class, such as Person, also has its own constructors. In the definition of a constructor for the derived class, the typical first action is to call a constructor of the base class. For example, consider defining a constructor for the class Student. One thing that needs to be initialized is the student’s name. Since the instance variable ...
Read now
Unlock full access