What is the result?

Given:

11. public static void main(String[] args) {
12. for (int i = 0; i <= 10; i++) {
13. if (i > 6) break;
14. }
15. System.out.println(i);
16. }

What is the result?

Given:

11. public static void main(String[] args) {
12. for (int i = 0; i <= 10; i++) {
13. if (i > 6) break;
14. }
15. System.out.println(i);
16. }

What is the result?

A.
6

B.
7

C.
10

D.
11

E.
Compilation fails.

F.
An exception is thrown at runtime.



Leave a Reply 0

Your email address will not be published. Required fields are marked *