Parameter Mystery
Category: Parameter Mystery
Author: Marty Stepp and 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 a = "felt"; String b = "saw"; String c = "drew"; String saw = "sue"; String drew = "b"; mystery(a, b, c); mystery(b, a, saw); mystery(drew, c, saw); mystery("a", saw, drew); mystery(a, a, "drew"); } public static void mystery(String b, String a, String c) { System.out.println(c + " " + a + " the " + b); } }
1) mystery(a, b, c);
2) mystery(b, a, saw);
3) mystery(drew, c, saw);
4) mystery("a", saw, drew);
5) mystery(a, a, "drew");