logo CodeStepByStep logo

ParameterMysteryClaim

Language/Type: Java parameters

The following console program uses parameters and produces four lines of output. What are they?

public class ParameterMysteryClaim {
    public static void main(String[] args) {
        String hear = "bad";
        String song = "good";
        String good = "hear";
        String walk = "talk";
        String talk = "feel";
        String feel = "walk";
        claim(feel, song, feel);
        claim(good, hear, song);
        claim(talk, "song", feel);
        claim("claim", talk, walk);
    }

    public static void claim(String hear, String good, String song) {
        System.out.println("to " + hear + " the " + song + " is " + good);
    }
}
line 1
line 2
line 3
line 4

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.