From Dan Chisholm's
public class Test20 extends Base2{
public static void main(
String args[])throws Exception{
Test20 t= new Test20();
}
public Test20()throws Exception {
System.out.println("subclass default constructor");
}
}
class Base2{
Base2() throws Exception{
System.out.println("superclass default constructor");
}
}
I am getting output as
superclass default constructor
subclass default constructor
I am clear with this.But for the following code
public class Test20 extends Base2{
Test20 t= new Test20();
public static void main(String args[]){//throws Exception{
}
public Test20()throws Exception {
System.out.println("subclass default constructor");
}
}
class Base2{
Base2() throws Exception{
System.out.println("superclass default constructor");
}
}
I am not getting any output
Some one please explain the difference.