kapreski
0
Q:

when super add by constructor in java

/* superclass Person */
class Person 
{ 
    Person(int i) 
    { 
        System.out.println("Person class Constructor"); 
    } 
} 
  
/* subclass Student extending the Person class */
class Student extends Person 
{ 
    Student() 
    { 
        // invoke or call parent class constructor 
        super(); 
  
        System.out.println("Student class Constructor"); 
    } 
} 
  
/* Driver program to test*/
class Test 
{ 
    public static void main(String[] args) 
    { 
        Student s = new Student(); 
    } 
} 
0

New to Communities?

Join the community