Menu
Question Index
...

What will be the output of the following program?

public class History
{
    public static void main(String[] args)
    {
        String song = "good";
        String talk = "feel";
        String feel = "walk";
        getOutput(talk, "song", feel);
    }
    public static void getOutput(String hear, String good, String song)
    {
        good = "" + song + " " + hear + " " + good;
        System.out.println("to " + hear + " the " + song + " is " + good);
    }
}


to feel the walk is good song walk
to feel the walk is walk feel song
to feel the song is talk song feel
to hear the song is song hear good
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java Methods - Parameter Passing And Scope

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App