same way but it could require that we override the sniff methodas bloodhound has much more sensitive sense of smell than standard dog in this waythe bloodhound class specializes the methods of its superclassdog extension in using extensionon the other handwe utilize inheritance to reuse the code written for methods of the superclassbut we then add new methods that are not present in the superclassso as to extend its functionality for examplereturning to our dog classwe might wish to create subclassbordercolliewhich inherits all the standard methods of the dog classbut then adds new methodherdsince border collies have herding instinct that is not present in standard dogs by adding the new methodwe are extending the functionality of standard dog in javaeach class can extend exactly one other class even if class definition makes no explicit use of the extends clauseit still inherits from exactly one other classwhich in this case is class java lang object because of this propertyjava is said to allow only for single inheritance among classes types of method overriding inside the declaration of new classjava uses two kinds of method overridingrefinement and replacement in the replacement type of overridinga method completely replaces the method of the superclass that it is overriding (as in the sniff method of bloodhound mentioned abovein javaall regular methods of class utilize this type of overriding behavior in the refinement type of overridinghowevera method does not replace the method of its superclassbut instead adds additional code to that of its superclass in javaall constructors utilize the refinement type of overridinga scheme called constructor chaining namelya constructor begins its execution by calling constructor of the superclass this call can be made explicitly or implicitly to call constructor of the superclass explicitlywe use the keyword super to refer to the superclass (for examplesuper(calls the constructor of the superclass with no arguments if no explicit call is made in the body of constructorhoweverthe compiler automatically insertsas the first line of the constructora call to super((there is an exception to this general rulewhich is discussed in the next section summarizingin javaconstructors use the refinement type of method overriding whereas regular methods use replacement the keyword this