Given three files:
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.
My understanding about the following is :
1. if class TestXcom would have extended from class B, I could use both B and D as Answer.. correct me if Wrong..
2. if I had to call the method go() from Class B, could I do so by adding options B or D?
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.
My understanding about the following is :
1. if class TestXcom would have extended from class B, I could use both B and D as Answer.. correct me if Wrong..
2. if I had to call the method go() from Class B, could I do so by adding options B or D?