// filename: Test2.java
class Test1 {
Test1(int x) {
System.
out.
println("Constructor called " + x
); }
}
// This class contains an instance of Test1
class Test2 {
Test1 t1 = new Test1(10);
Test2(int i) { t1 = new Test1(i); }
public static void main
(String[] args
) { Test2 t2 = new Test2(5);
}
}
Ly8gZmlsZW5hbWU6IFRlc3QyLmphdmEKY2xhc3MgVGVzdDEgeyAgIAogICAgVGVzdDEoaW50IHgpIHsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkNvbnN0cnVjdG9yIGNhbGxlZCAiICsgeCk7CiAgICB9Cn0KICAKLy8gVGhpcyBjbGFzcyBjb250YWlucyBhbiBpbnN0YW5jZSBvZiBUZXN0MSAKY2xhc3MgVGVzdDIgeyAgICAKICAgIFRlc3QxIHQxID0gbmV3IFRlc3QxKDEwKTsgICAKICAKICAgIFRlc3QyKGludCBpKSB7IHQxID0gbmV3IFRlc3QxKGkpOyB9IAogIAogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgeyAgICAKICAgICAgICAgVGVzdDIgdDIgPSBuZXcgVGVzdDIoNSk7CiAgICB9Cn0=