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.

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart