Hi All,
In this pgm I thought answer is E.bcoz class A is not imported.Eventhough Class B inherited class A methods,to access class A methods we must include class A also.Am I right?If I am wrong,please clarify me.Thanks.
package xcom;
public class A {
// insert code here
}
package xcom;
public class B extends A {public void doB() { System.out.println("B.doB"); } }
import xcom.B;
class TestXcom {
public static void main(
String[] args) {
B b = new B(); b.doB(); b.go();
}
}
Which, inserted at // insert code here will allow all three files to compile? (Choose all
that apply.)
A. void go() { System.out.println("a.go"); }
B. public void go() { System.out.println("a.go"); }
C. private void go() { System.out.println("a.go"); }
D. protected void go() { System.out.println("a.go"); }
E. None of these options will allow the code to compile.