Given: What is the result?
A.
Red 0 Orange 1
B.
Red 0 Orange 0 Green 6
C.
Green 4
D.
Compilation fails
E.
Red 0 Orange 0 Green 3
Given: What is the result?
A.
Red 0 Orange 1
B.
Red 0 Orange 0 Green 6
C.
Green 4
D.
Compilation fails
E.
Red 0 Orange 0 Green 3
D
D because you can’t use break in if-else statements. It can only be used in loops and switch
Also sum is an instance variable. Static methods and variables can’t access the instance members of a class.
d
tested