자격증/OCJP_ExamC

QUESTION 30

IT grow. 2018. 7. 24. 03:30
반응형
QUESTION 30
Given:
1. public class Breaker {
2. static String o = "";
3.
4. public static void main(String[] args) {
5. z: o = o + 2;
6. for (int x = 3; x < 8; x++) {
7. if (x == 4)
8. break;
9. if (x == 6)
10. break z;
11. o = o + x;
12. }
13. System.out.println(o);
14. }
15. }
What is the result?
A. 23
B. 234
C. 235
D. 2345
E. 2357
F. 23457
G. Compilation fails.
Solution : G



plus imformation 

 Main.java:10: undefined label: z

                 break z;

                 ^ 1 error 



반응형