2
$\begingroup$

In object-oriented programming, I have learned the concept of subtyping and inheritance.
I thought they're the same thing, in the beginning. But I was told that they're totally different.

So what's there difference? What's there relationship?

$\endgroup$
2
$\begingroup$

See the following discussions in other stack exchange groups.

See discussion in https://stackoverflow.com/questions/23592131/what-is-the-difference-between-subtyping-and-inheritance-in-oo-programming

Also see https://cstheory.stackexchange.com/questions/10620/how-does-inheritance-differ-from-subtyping

However there is some differences of opinion. See Inheritance Is Subtyping as well as Inheritance Is Not Subtyping

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.