Is there any notion of " Interface inheritance is public inheritance, while implementation inheritance is private inheritance" in java?
I have read this post.
Is there any notion of " Interface inheritance is public inheritance, while implementation inheritance is private inheritance" in java?
I have read this post.
I read the post you linked. In this post, Péter Török states about Private Inheritance the following:
However, if B privately inherits from A, B is-implemented-in-terms-of A: only the implementation of A is inherited, not its interface. Thus (references/pointers to) B objects can not be used in places where A objects are expected.
I don't think there is such thing in Java as Private Inheritance, at least in the terms expressed above.
So, after reading the post and considering that in Java:
I think it is not possible the case where you create a Class B
that implements an Interface A
or extends a Class A
, and this Class B
couldn't be used as A
.