Menu
Question Index
...

What will be the output of the following program?

public class Highlight {
    public static void main(String[] args) {
        int[] numbers = {10, 20, 30, 40, 50, 60, 70, 80, 90};
        for (int x : numbers) {
            if (x == 30 || x == 60 || x == 90 || x == 120) {
                continue;
            }
            System.out.print(x + " ");
            continue;
        }
    }
}


10 20 30 40 50 60 70 80 90 120
10 20 30 40 50 60 70 80 90
10 20 40 50 70 80
Compilation Error
Runtime Error

Doubts

Problems

Topic: For-each Loop In Core Java Programming

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App