Java / Inheritance
Difference between Inheritance and Encapsulation.
Inheritance is an object oriented concept which creates a parent-child relationship. It is one of the ways to reuse the code written for parent class but it also forms the basis of Polymorphism.
Encapsulation is an object oriented concept which is used to hide the internal details of a class, for example, HashMap encapsulate how it store elements and calculate hash values.
More Related questions...