Given a java source file: What changes will make this code compile? (Select Two)
A.
Removing the private modifier from the two () method
B.
Adding the public modifier to the declaration of class x
C.
Adding the protected modifier to the x() constructor
D.
Changing the private modifier on the declaration of the one() method to protected
E.
Removing the Y () constructor
No image for question here.
no image present here.
the question should be this:
Given a java source file:
class x {
x () {}
private void one () {}
}
public class Y extends x {
Y () {}
private void two () {one();}
public static void main (string [] args) {
new Y().two ();
}
}
the should be only the “D” AND NOT also “A”
CD