Menu
Question Index
...

What will be the output of the following program?

public class DemoOnContinue {
    public static void main(String args[]) {
        int first = 5, second = 20;
        do {
            if (first++ > --second) {
                continue;
            }
          } while (first < 15);
        System.out.println("first = " + first + " and second = " + second);
    }
}


first = 15 and second = 15
first = 10 and second = 15
first = 15 and second = 10
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java continue Statement

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App