Mega Code Archive

 
Categories / Java Tutorial / Class Definition
 

The keyword super represents an instance of the direct superclass of the current object

You can explicitly call the parent's constructor from a subclass's constructor by using the super keyword. 'super' must be the first statement in the constructor. class Parent {        public Parent(){                }      }      public class Child extends Parent {          public Child () {            super();          }      }