// Whitaker Brand // CSE142 17au // TA: Miya // Section: AA // This class demonstrates a simple example of using parameters. public class ParameterExample { public static void main(String[] args) { // Recall: variable declaration and assignment // on separate lines: //int x; //x = 5; // This line is a shorthand where we declare and // assign in one line int x = 5; printX(x); } // This method prints the value of the given parameter. // Note the variable declaration, but no assignment // The value of x (here in this method) comes from // the place in the code where we call the method. // (Line 17 in this program) public static void printX(int x) { System.out.println("x = " + x); } }