+ 1
Abstract Class
If I inherit from abstract class can I define a new function in child class that does not exist in parent class? check this out https://code.sololearn.com/c5KQ8EpLfQ7I
2 odpowiedzi
+ 4
"Can I define a new function in child class that doesn't exist in parent class?
Yes, but here that is not the issue. <D> is a pointer to `Animal` object not `Dog` object. So the call to `onlyDogThing()` method which was defined only in `Dog` class fails.
+ 1
Thanks.