According to Oracle's documentation https://docs.oracle.com/javase/tutorial/java/IandI/super.html, its written that If the super class does not have a no-argument constructor, you will get a compile-time error.
But in my case, I have a super class without any constructor. In my baseclass, I am writing super() in its no-arg constructor. Here, I don't have a no-arg constructor in super class, but its not showing any error.
class Person {
}
/* 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 class
class Practice {
public static void main(String[] args) {
Student s = new Student();
}
}