What is the result?

Given:
1. class Test {
2. public static void main(String args[]) {
3. int i = 1;

4. while (i– > 1) {
5. System.out.println(“i : ” + i);
6. }
7. }
8. }
What is the result?

Given:
1. class Test {
2. public static void main(String args[]) {
3. int i = 1;

4. while (i– > 1) {
5. System.out.println(“i : ” + i);
6. }
7. }
8. }
What is the result?

A.
i : 1

B.
i : -1

C.
i : 0

D.
No output is produced.

E.
Compilation fails.



Leave a Reply 0

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