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 john = "skip"; String mary = "george"; String george = "mary"; String fun = "drive"; String work = "john"; statement(mary, john, fun); statement(george, work, john); statement(fun, "george", "work"); statement(george, mary, john); statement(george, "john", "dance"); } public static void statement(String mary, String john, String fun) { System.out.println(john + " likes to " + fun + " with " + mary); } } List below the output produced by this program.
1) statement(mary, john, fun);
2) statement(george, work, john);
3) statement(fun, "george", "work");
4) statement(george, mary, john);
5) statement(george, "john", "dance");