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 x = "java";
        String y = "tyler";
        String z = "tv";
        String rugby = "hamburger";
        String java = "donnie";

        hamburger(x, y, z);
        hamburger(z, x, y);
        hamburger("rugby", z, java);
        hamburger(y, rugby, "x");
        hamburger(y, y, "java");
    }

    public static void hamburger(String y, String z, String x) {
        System.out.println(z + " and " + x + " like " + y);
    }
}

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

hamburger(x, y, z);
hamburger(z, x, y);
hamburger("rugby", z, java);
hamburger(y, rugby, "x");
hamburger(y, y, "java");

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.