Yes, a comic book is a kind of book so inheritance makes sense. If it doesn’t make sense use association or the has-a relationship instead. Only use inheritance when the child class is really a type of the parent class, otherwise use association .
Is inheritance same as association?
Yes, a comic book is a kind of book so inheritance makes sense. If it doesn’t make sense use association or the has-a relationship instead. Only use inheritance when the child class is really a type of the parent class, otherwise use association .