It appears that some of the posted code is out of Sync with the topic.
This happens in several topics.
Regards,
It appears that some of the posted code is out of Sync with the topic.
This happens in several topics.
Regards,
What part? The code shown (below the video tool) for subclassing Apple to Fruit looks fine. It’s a standard do-nothing example that you’d see anywhere.
The posted code is not the same code from the lesson, it’s from one of the previous lessons.
As I said
posted code is out of Sync with the topic.
Ah… yes and no. The written out code isn’t from an old lesson, and is fine for the topic. You’re wrong about that. But it doesn’t match the code in the video.
The “Inheritance” lesson has them match, and has Apple a subclass of Fruit. The written out code for “Overriding” extends that, by having Apple override Fruit.Chop. But the video code uses Monsters, Orcs, and overrides Yell(). Otherwise it’s the same example.
There’s nothing really wrong, since both examples show the same idea. I suppose they should match. Of course, neither shows why you’d want virtual functions. Showing how they work is the easy part.