Forums Register Login

package problems

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
 

Devaka Cooray wrote:Please QuoteYourSources



source : Katherine sierra & bert bates book.. chapter 10 about packages.. it is one of self test questions
+Pie Number of slices to send: Send
Please do a search for "xcom" (use the "Search" link in the top right of the page) - this question has been discussed many times before here on JavaRanch.
This guy is skipping without a rope. At least, that's what this tiny ad said:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 731 times.
Similar Threads
K&B Ch10#8 protected access question
doubt with master exam q. 66 and 76 (q. 76 answered)
Packages
My Question SCJP
Q. 62 from examlab practice test: Wrong
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:27:44.