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 he = "we";
String says = "can";
String yes = "he";
String we = "yes";
slogan(we, yes, says);
slogan(says, "Barry", "maybe");
slogan(says, he, yes);
slogan("can't", "Sarah", "no");
}
public static void slogan(String can, String he, String yes) {
System.out.println(he + " says " + yes + " we " + can);
}
}
List below the output produced by this program.
1) slogan(we, yes, says);
2) slogan(says, "Barry", "maybe");
3) slogan(says, he, yes);
4) slogan("can't", "Sarah", "no");