Which three lines are illegal?
A.
line 10
B.
line 11
C.
line 6
D.
line 5
E.
line 4
F.
line 3
G.
line 13
Explanation:
Which three lines are illegal?
A.
line 10
B.
line 11
C.
line 6
D.
line 5
E.
line 4
F.
line 3
G.
line 13
Explanation:
CDG
Answers: C, D, G
Explanation:
Line 5 is illegal because method three() is a non-static method referenced into a static method. In java you can’t directly reference a non-static method inside a static method.
Line 6 and 13 are illegal because method four() is not static and in java you can’t make a static reference to a non-static method.