because the caller of (does not have to know whether the object refers to an instance of or in order to get the (method to execute correctly thusthe object variable can be polymorphicor take many formsdepending on the specific class of the objects it is referring to this kind of functionality allows specialized class to extend class sinherit the standard methods from sand redefine other methods from to account for specific properties of objects of some object-oriented languagessuch as javaalso provide useful technique related to polymorphismwhich is called method overloading overloading occurs when single class has multiple methods with the same nameprovided each one has different signature the signature of method is combination of its name and the type and number of arguments that are passed to it thuseven though multiple methods in class can have the same namethey can be distinguished by compilerprovided they have different signaturesthat isare different in actuality in languages that allow for method overloadingthe run-time environment determines which actual method to invoke for specific method call by searching up the class hierarchy to find the first method with signature matching the method being invoked for examplesuppose class twhich defines method ()extends class uwhich defines method ( ,yif an object from class receives the message " ( , ),then it is ' version of method that is invoked (with the two parameters and ythustrue polymorphism applies only to methods that have the same signaturebut are defined in different classes inheritancepolymorphismand method overloading support the development of reusable software we can define classes that inherit the standard instance variables and methods and can then define new more-specific instance variables and methods that deal with special aspects of objects of the new class using inheritance in java there are two primary ways of using inheritance of classes in javaspecialization and extension specialization in using specialization we are specializing general class to particular subclasses such subclasses typically possess an "is arelationship to their superclass subclass then inherits all the methods of the superclass for each inherited methodif that method operates correctly independent of whether it is operating for specializationno additional work is needed ifon the other handa general method of the superclass would not work correctly on the subclassthen we should override the method to have the correct functionality for the subclass for examplewe could have general classdogwhich has method drink and method sniff specializing this class to bloodhound class would probably not