Sunday, 16 June 2013

What is the use of Super Keyword in java?



A sub class inherit the accessible data fields and method from its super class but the constructor of the super class are not inherited in the sub class. They can only be invoked from constructor of the sub class using keyword Super. The keyword Super refers to super class of the class in which super appears. TheSntax used to called super class constructur is
Super(arguments);
This statement invokes the constructor with argument and
Super();
This invokes the constructor without argument.

No comments:

Post a Comment