자격증/OCJP_ExamC

QUESTION 33

IT grow. 2018. 7. 24. 20:08
반응형
QUESTION 33
Given:
1. public static void main(String[] args) {
2. for (int i = 0; i <= 10; i++) {
3. if (i > 6) break;
4. }
5. System.out.println(i);
6. }
What is the result?
A. 6
B. 7
C. 10
D. 11
E. Compilation fails.
F. An exception is thrown at runtime.
Solution : E



plus imformation 


Main.java:5: cannot find symbol 

symbol  : variable i 

location: class Breaker

         System.out.println(i);

                      ^ 1 error 

 


반응형