I don't Understand why Default constructor is executed after parameterized constructor in this program ?
class A{
int a , b;
A(){
this(10,20);
System.out.println("Inside Default Constructor values:"+a+" "+b);
}
A(int a , int b){
this.a=a;
this.b=b;
System.out.println("Inside Parameterized Constructor values:"+a+" "+b);
}
}
public class thisExample {
public static void main(String[] args) {
A obj = new A();
}
}
This gives output as :
Inside Parameterized Constructor values:10 20
Inside Default Constructor values:10 20