Parameter Mystery
Category: Parameter Mystery
Author: Stuart Reges
Book Chapter: 3.1
Problem: Parameter Mystery
Consider the following program.
public class Mystery {
public static void main(String[] args) {
String she = "it";
String it = "her";
String her = "you";
String you = "she";
saying(you, it, you);
saying(it, her, she);
saying(she, "you", her);
saying(it, "him", "fred");
}
public static void saying(String it, String her, String she) {
System.out.println(she + " can't take " + it + " with " + her);
}
}
List below the output produced by this program.
1) saying(you, it, you);
2) saying(it, her, she);
3) saying(she, "you", her);
4) saying(it, "him", "fred");