// Greeter Project // Greeter3 Module // Source code file: Main.java // Input a person's name, then use the makeGreeting method // to construct a greeting to that person. Unlike Module 2 // The definition and invocation of the makeGreeting method // are in separate files. import java.util.Scanner; public class Main { public static void main(String[ ] args) { // Create scanner object. Scanner scanner = new Scanner(System.in); // Read name and print greeting. // Display prompt for input to standard err. System.err.print("Enter your name: "); String name = scanner.nextLine( ); // Because the makeGreeting method is defined in // a separate file, it must be qualified with the // class name. System.out.println(Greeter.makeGreeting(name)); // Close scanner. scanner.close( ); } }