Menu
Question Index
...

What will be the output of the following program?

public class BlockOfCode {
    public static void main(String[] args) {
        System.out.println("Main");
        {
            System.out.println("Bolck 1");
        }
        {
            System.out.print("Bolck 2, ");
            {
                System.out.print("Bolck 2.1, ");
                {
                    System.out.println("Bolck 2.1.1");
                }
            }
        }
        {
            System.out.println("Bolck 3");
        }
    }
}


Main
Bolck 1
Bolck 2, Bolck 3
Bolck 2.1, Bolck 2.1.1
Main
Bolck 1
Bolck 2, Bolck 2.1, Bolck 2.1.1
Bolck 3
Compilation Error
Runtime Error

Doubts

Problems

Topic: Block Of Code In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App