Which three lines are illegal?

<code>
1. class StaticMethods {
2. static void one() {
3. two();
4. StaticMethods.two();
5. three();
6. StaticMethods.four();
7. }
8. static void two() { }
9. void three() {
10. one();
11. StaticMethods.two();
12. four();
13. StaticMethods.four();
14. }
15. void four() { }
16. }
</code>
Which three lines are illegal?


1. class StaticMethods {
2. static void one() {
3. two();
4. StaticMethods.two();
5. three();
6. StaticMethods.four();
7. }
8. static void two() { }
9. void three() {
10. one();
11. StaticMethods.two();
12. four();
13. StaticMethods.four();
14. }
15. void four() { }
16. }

Which three lines are illegal?

A.
line 3

B.
line 4

C.
line 5

D.
line 6

E.
line 10

F.
line 11

G.
line 12

H.
line 13



Leave a Reply 2

Your email address will not be published. Required fields are marked *


sully

sully

i get why line 5 doesn’t work because there is no method 3 to go along with it
confused about the other 2 is it just because the calling method is 1st.

Gordon

Gordon

line 6 and line 13 should use
new StaticMethods.four();