Java #1

Right to start writing Java programs you need to download the Java Software Development Kit (SDK) from here at the sun.com site. Once you have that done you may what to use an IDE, one good one for Java is JCreator, you can use it for free.

Now open up the IDE/Text Editor and enter the following for the Basic Hello World Example!

public class <filename> {
    public static void main(String args []){
        System.out.println("Hello World!");
    }
}

The first starts the public class.

The second line calls the main method. Like C++ the main method is what gets called first when the program is run, so this always needs to be there unless you are writing a class file (I think)

The third line is used to print messages to the screen. There are two ways to do this, one is like the above. and the other is:

System.out.print("Hello World!");

This way with just the print, makes the cursor not return. I’ll upload some pictures later, but when you run it you’ll understand.

Hope this helped any questions just ask.