What’s the Output?
Examine the following code and determine the output.
public abstract class Test { protected int value1; int value2; Test() { value1 = 0; value2 = 0; } Test(int value1) { this.value1 = value1; value2 = value1; } public void implementEd() { for (int j = 0; j public class TestTest extends Test { int myvariable; TestTest() { super(); myvariable = 3; } TestTest(int x) { super(x); myvariable = x + 3; } public void notImplemented(int x) { value2 = value2 + x; value1 = value1 * x; System.out.println("This was called with the value " + x); System.out.println("My variable is " + myvariable); } public static void main(String[] args) { TestTest h = new TestTest(); TestTestj = new TestTest(4); h. implementEd(); h.notImplemented(5); h.implementEd(); System.out. println(h.value2);System.out. println(h.value1); j.implementEd(); j.notImplemented(5); j.implementEd(); System.out.println(j.value1); System.out.println(j.value2); } }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.