Menu
Question Index
...

What will be the output of the following program?

class DemoOnLabel
{
    public static void main(String args[])
    {
        outer : for (int first = 0; first < 3; first++)
        {
            for (int second = 3; second >= 0; second--)
            {
                if (first == second)
                    continue outer;
                System.out.println(first + " " + second);
             }
          }
     }
}


0 3
0 2
0 1
1 3
1 2
2 3
0 2
0 3
1 3
2 3
0 1
1 2
0 2
0 1
0 3
1 3
2 3
1 2
0 2
0 1
1 2
2 3
1 3
0 3
Compilation Error or 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