// File: Helloworld2.java // Author: Rahul Simha // Date created: August 14, 1998. // // Note how in-line comments start with // // I will follow the above convention of filename, author etc. public // Accessible outside this file. "public" is a reserved word. class // "class" is a reserved word. HelloWorld2 // The name of the class - same name as filename. { // Braces instead of begin/end. public // This function must be accessible. "public" is reserved. static // "static" is reserved. void // The return value - nothing. "void" is reserved. main // To start execution, a class must have a "main" function. // "main" is sort-of reserved. (String[] argv) // Command line parameters are placed by the run-time system // in argv[0], argv[1], etc. { System.out.println ("Hello World!"); // System.out is an object that contains a useful function // called println, which takes in a string and prints it out on // a new line. System.out.println ("Here's the list of arguments you gave me:"); for (int i=0; i