Pages

Sunday, June 10, 2012

Hello World


The first step is to create a "Hello World". Here we will start with a main programm which only print the message "Hello World" in the console.
public class HelloWorld{ public static void main(String[] args){ System.out.println("Hello World"); }}

This code must be saved in a file with the same name as the class (in this case "HelloWorld.java"). Then we can run the example with the following commands:
> java HelloWorld.java

For running this example a Java Virtual Machine must be installed in the computer.

No comments:

Post a Comment