logo Practice-It logo

parameter mystery

Author: Marty Stepp (on 2010/12/28)

Given the following program:

public class ParameterMystery {
    public static void main(String[] args) {
        String literal = "8";
        String brace = "semi";
        String paren = brace;
        String semi = "brace";
        String java = "42";

        param(java, brace, semi);
        param(literal, paren, java);
        param(brace, semi, "literal");
        param("cse", literal + 4, "1");
    }

    public static void param(String semi, String java, String brace) {
        System.out.println(java + " missing a " + brace + " and " + semi);
    }
}

Write the output of each of the following calls, as it would appear on the console.

param(java, brace, semi);
param(literal, paren, java);
param(brace, semi, "literal");
param("cse", literal + 4, "1");

You must log in before you can solve this problem.


Log In

If you do not understand how to solve a problem or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect problems/tests, etc.), please

Is there a problem? Contact a site administrator.