Question: 7. Consider the following class definitions. public class A { private int al; public void methodA() { methodB(); // Statement I } } public class
7.
Consider the following class definitions.
public class A
{
private int al;
public void methodA()
{
methodB(); // Statement I
}
}
public class B extends A
{
public void methodB()
{
methodaA(); // Statement II
al = 0; // Statement III
}
}
Which of the labeled statements in the methods shown above will cause a compile-time error?
-
I only
I only
A
-
III only
III only
B
-
I and II
I and II
C
-
I and III
I and III
D
-
II and III
II and III
E
Submit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
