What is the result?

Given:

1. public class Breaker2 {
2. static String o = “”;
3.
4. public static void main(String[] args) {
5. z: for (int x = 2; x < 7; x++) {
6. if (x == 3)
7. continue;
8. if (x == 5)
9. break z;
10. o = o + x;
11. }
12. System.out.println(o);
13. }
14. }

What is the result?

Given:

1. public class Breaker2 {
2. static String o = “”;
3.
4. public static void main(String[] args) {
5. z: for (int x = 2; x < 7; x++) {
6. if (x == 3)
7. continue;
8. if (x == 5)
9. break z;
10. o = o + x;
11. }
12. System.out.println(o);
13. }
14. }

What is the result?

A.
2

B.
24

C.
234

D.
246

E.
2346

F.
Compilation fails.

Explanation:



Leave a Reply 1

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