Menu
Question Index
...

What will be the output of the following program?

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


Main
Block 1
Block 2, Block 3
Block 2.1, Block 2.1.1
Main
Block 1
Block 2, Block 2.1, Block 2.1.1
Block 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