// CommandLineDemo2.java
// Demonstrates command-line arguments
// Expects the user to type:
//
// java CommandLineDemo2 firstname middlename lastname
//
// using one's actual first, middle, and last names.
// Displays user-friendly message if user does not
// type at least three command-line arguments.
public class CommandLineDemo2 {
public static void main(String[] args)
{
if ( args.length < 3 ) {
System.out.print("This program will echo your ");
System.out.println("name if you type it as");
System.out.println("three command-line arguments.");
} // if
String name;
name = args[0] + " " + args[1] + " " + args[2];
System.out.println("Hello, " + name + ".");
} // method main
} // class CommandLineDemo2