Consider this code:
class Test {
Test() {
System.out.println(\"In constructor of Superclass\");
}
int adds(int n1, int n2) {
ret
As we know that member variables(fields)of a class must be initialized before creating an object because these fields represent the state of object. If these fields are explicitely not initilized then compiler implicitely provides them default values by calling no-argument default constructor. Thats why subclass constructor invokes super class no-argument default constructor or implicitely invoked by compiler .Local variables are not provided default values by compiler.