Quantcast
Channel: Comments on: 11.4 — Constructors and initialization of derived classes
Viewing all articles
Browse latest Browse all 159

By: Lamont Peterson

$
0
0

Alex,

You have this sentence in the middle of this lesson:

"As you can see, the name and age in the base class were properly initialized, as was the number of home runs in the derived class."

I’m thinking that it might should read:

"As you can see, the name and age from the base class were properly initialized, as was the number of home runs from the derived class."

After all, the instantiated object is build from the class (BaseballPlayer, in this case) and storage is within the objects built from a class, not "in the class" itself.  Perhaps this is too subtle of a point at this stage, but I feel that it helps the understanding of using classes and the relationships of inheritance to separate the concept of the instantiated object from the compound declaration & definition of the class.  Like storing food in your house, not in the blueprints used to build your house (yes, I’m wanting to avoid the "blueprint" analogy, I know most people teaching OOP do as well).

Your thoughts?


Viewing all articles
Browse latest Browse all 159

Trending Articles