Previous | Next | Trail Map | Getting Started | Table of Contents


The "Hello World" Application

By following the steps on this page, you can create and use a standalone Java application.

Create a Java Source File

Create a file named HelloWorldApp.java with the Java code shown here:
/** 
 * The HelloWorldApp class implements an application that
 * simply displays "Hello World!" to the standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); //Display the string.
    }
}

Compile the Source File

Compile the source file using the Java compiler.

If compilation succeeds, the compiler creates a file named HelloWorldApp.class. If compilation fails, make sure you typed in and named the program exactly as shown above.

Run the Application

Run the program using the Java interpreter.

You should see "Hello World!" displayed on the standard output.

What Next?

Now you can:


Previous | Next | Trail Map | Getting Started | Table of Contents