What will be the output of the following program?
public class ComplexType {
private final int a;
int b, total;
protected static int c;
ComplexType(int a, int b, int c, int total) {
this.a = a;
this.b = b;
ComplexType.c = c;
this.total = total;
}
ComplexType(int a, int b, int c) {
this(a, b, c, a + c + 3);
}
ComplexType(int a, int b) {
this(a, b, c, a + b + c);
}
public void print() {
System.out.println("c = " + c + " total = " + total);
c = total;
}
public static void main(String[] args) {
ComplexType t1 = new ComplexType(4, 7, 2, 4 + 7 + 2);
t1.print();
ComplexType t3 = new ComplexType(ComplexType.c, ComplexType.c);
ComplexType t2 = new ComplexType(t1.a, ComplexType.c, t1.b);
t3.print();
t2.print();
}
}