asked in Inheritance by (58.6k points)

1 Answer

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. On the other hand, Encapsulation is an object oriented concept which is used to hide the internal details of a class e.g. HashMap encapsulate how to store element
answered by (58.6k points)

Java Interview Questions and Answers 2018

...