Which, inserted independently at line 3, will compile? (Choose all that apply.)
A. Faster f = Faster.Higher;
B. Faster f = Better.Faster.Higher;
C. Better.Faster f = Better.Faster.Higher;
D. Bigger.Faster f = Bigger.Faster.Higher;
E. Better.Faster f2; f2 = Better.Faster.Longer;
F. Better b; b.Faster = f3; f3 = Better.Faster.Longer;
Answer:
C and E are correct syntax for accessing an enum from another class.
A, B, D, and F are incorrect syntax.
(Objective 1.3)
==
class Bigger { public static void main(String[] args) { // insert code here } } class Better { enum Faster {Higher, Longer}; }
No comments:
Post a Comment