/** * file: Hello.java * * Basic Algorithms, V22.0310.003, Fall 1998 (Yap) * (Modified, Fall 1999) * $Id: Hello.java,v 1.1 1999/09/14 21:58:46 yap Exp yap $ * * This Hello World Program can compile and run in * the Windows environment as well as in Unix. * In unix, you compile this by typing: * * % javac Hello.java * * This produces the file Hello.class. * You can now run this "Hello" and provide it any number of * command line arguments. For example, try this: * * % java Hello How about this? * */ public class Hello { public static void main (String[] args) { System.out.print("Hello, World!\n"); // print message for (int i = 0; i < args.length ; i++ ) // print command line args System.out.print(args[i]+"\n"); // -- one per line System.out.print("Hit the return key to quit"); try {System.in.read();} // pauses for user to catch (Exception e){}; // hit the return key } // main }