Menu
Question Index
...

What will be the output of the following program?

public class Diwali {
    public static void main(String[] args) {
        String name = " Happy Diwali ";
        System.out.print("/**");
        for (int i = 0; i < name.length(); i++) {
            System.out.print(name.charAt(i));
        }
        System.out.println("**\");
    }
}


/** Happy Diwali **\
** Happy Diwali **
 Happy Diwali
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Advanced Java Programming Concepts

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App