Hacker News new | ask | show | jobs
by revskill 1228 days ago
The most confusing things about OOP is inheritance vs subtyping vs union.

You have a dequeue class, the stack and queue inherit dequeue. But dequeue is a subtype of stack and queue.

About union, could i say an abstract class is a union (implicitly) of all its subclasses ?

1 comments

No, because then all subclass members would be implicitly available on the base abstract type, I believe. So "union" here doesn't make sense.