✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Результат компіляції програмного коду:
public class TestMethod {
int a;
TestMethod(int i) {
a = i;
}
TestMethod method () {
TestMethod temp = new TestMethod(a * 2);
return temp;
}
}
public class TestMain {
public static void main(String []args) {
TestMethod ob1 = new TestMethod(10);
TestMethod ob2;
ob2 = ob1.method ();
System.out.println(ob1.a);
System.out.println(ob2.a);
ob2 = ob2.method ();
System.out.println(ob2.a);
}
}