Solution Review: Class Implementation
Let's find out the solution to the class implementation problem given in the previous lesson.
We'll cover the following...
We'll cover the following...
Solution
Let’s take a look at the solution.
Explanation
Let’s start reviewing the code line by line.
Constructor
As you can see from the object instantiation at line 21, we need three parameters for implementing the constructor.
- The sample output shows that upon calling
book.titleit prints “Who Moved My Cheese,” and while calling