Showing posts with label super. Show all posts
Showing posts with label super. Show all posts

Tuesday, 21 January 2014

METHOD OVERRIDING IN JAVA

Method Overriding

Brief note about method overriding 


Method overriding means have same signature but with different implementation. It occurs when a class declares a method that has the same type signature as a method declared by one of its super classes.Signature is a combination of a method name and the sequence of its parameter types.When a method in the subclass overrides a method in a super class, the method in the super class is hidden relative to the subclass object.Method Overriding is a very important feature of java because it forms the basis for run-time polymorphism.  

Using super in java

how to use super keywords:constructors

super:

super has two general forms. The first calls the superclass’ constructor. The second is used to access a member of the superclass that has been hidden by a member of a subclass.