can somebody explain me the difference between inh...
# announcements
n
can somebody explain me the difference between inheritance and implementation and how they affect the memory of system?
m
What exactly do you mean by implementation?
a
@Nishoobansal by implementation if you mean implementing interfaces, then the question is not about inheritance and implementation, it is about the difference in the concept of inheritance from classes and interfaces.
n
Thanks for the help but I understood now. 👍
👍 1
m
What you need to distinguish is the difference between “implementation inheritance”*(1)* (extending a concrete or abstract class) and “type inheritance”*(2)* (implementing an interface). (1) can be easily misused and lead to deep and brittle class hierarchies, while (2) is more flexible, because it describes roles or traits of your type, doesn’t force you to inherit implementation details and is to be preferred.