What is the output of the following code?
class Test { Test() { System.out.println("a"); int k = 10; System.out.println("b"); this(k); System.out.println("c"); } Test(int x) { System.out.println(x); } } public class Main { public static void main(String[] args) { new Test(); } }
this(k); // Second statement. A compile-time error
A call to the constructor with int parameter this(k) is not the first statement inside the constructor's body.