Menu
Question Index
...

What will be the output of the following program?

public class DemoOnClasses
{
    public static void main(String args[])
    {
        String str = output();
        System.out.print(str);
    }
    String output()
    {
        return "Good Morning";
    }
}


Good Morning
"Good Morning"
Good
Morning
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Methods

Read this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App