1. Sample 1: Hello, Eliza
Our first non-gui Java program:
// Hello World, console program
// M.Y. Name
class Hello {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
Put that into a file named Hello.java using a file editor (see BrynMawrFileEditing for more details).
To compile this program:
$ javac Hello.java
Now, you are ready to run the program:
$ java Hello
