Parameter Mystery
Category: Parameter Mystery
Author: Benson Limketkai
Book Chapter: 3.1
Problem: Parameter Mystery
At the bottom of the page, write the output produced by the following program, as it would appear on the console. public class ParameterMystery { public static void main(String[] args) { String what = "pinky"; String want = "brain"; String tonight = "narf"; String you = "tonight"; String pinky = "egad"; String brain = "what"; String narf = "want"; mystery(what, "want", "tonight"); mystery("egad", want, tonight); mystery(you, brain, narf); mystery(pinky, "and the", brain); } public static void mystery(String tonight, String what, String want) { System.out.println(what + " do you " + want + " to do " + tonight); } }
1) mystery(what, "want", "tonight");
2) mystery("egad", want, tonight);
3) mystery(you, brain, narf);
4) mystery(pinky, "and the", brain);