Question: Given the following three classes, which are all defined in the same file. class A { private int x = 0; public void m()
Given the following three classes, which are all defined in the same file. class A { private int x = 0; public void m() { x = 1; } class B extends A { private int y = 0; @Override } public void m()) { y = 2; } class C extends A { private int z = 0; @Override public void m() { z = 3; super.m(): And, the following code fragment. A al = new B(): A a2 = new CO: al.m(): a2.m(): What is the value of x after calling a1.m()? What is the value of x after calling a2.m ()?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
