// Helene Martin, CSE 142 // Use the debugger to see each step in the parameter passing process public class ParamDemo { public static void main(String[] args) { favNumber(12); int johnFav = 45; favNumber(johnFav); // the value of johnFav gets copied into the method //favNumber(); // error, no definition for favNumber without a param favNumber(5.5); //favRepeat(12); //favRepeat(45); } // General syntax: public static void methodName(type paramName) public static void favNumber(double num) { System.out.println("My favorite number is " + num + "."); } public static void favRepeat(int num) { for(int i = 1; i <= num; i++) { System.out.println(num + " is the best"); } } }