javainheritancepublic-method

What is the difference between inherited methods and public methods?


I have trouble understanding how an inherited method in a subclass from a superclass differs from a public method in a class which can be used in another class.


Solution

  • Please go through the basic OOP concepts, you will understand the difference. Very short answer could be that public methods you can just access where as using inheritance subclasses can modify existing behaviour.