logo Practice-It logo

parameter mystery

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

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

public class ParameterMystery {
    public static void main(String[] args) {
        String butters = "kenny";
        String friends = "butters";
        String kenny = "friends";
        String kyle = "stan";
        String ike = "cartman";

        stotch(kenny, friends, butters);
        stotch(ike, friends, kyle);
        stotch(kyle, ike, "ike");
        stotch(friends, "kyle", kenny);
    }

    public static void stotch(String kenny, String butters, String friends) {
        System.out.println(butters + " is " + friends + " with " + kenny);
    }
}
stotch(kenny, friends, butters);
stotch(ike, friends, kyle);
stotch(kyle, ike, "ike");
stotch(friends, "kyle", kenny);

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.