Java logo Marty's Java Tutorial Java logo

This page teaches you about some of Java's basic syntax. For more information, see Sun Microsystems' official Java web site.

Lesson 1: Basic Java Programs

Java is a powerful, multi-platform programming language. It will also soon be a free and open-source language. James Gosling, one of Java's creators, has this to say about the Java source code:

"The source code is being open sourced, but the process of defining the spec is still the Java Community Process."

-- James Gosling, Vice President and Sun Fellow, Sun Microsystems

A Java program is written in 3 steps:

  1. Write the source code.
  2. Compile the program (translate it into binary format).
  3. Run the program.

A program contains println statements to produce output:

public class name {
    public static void main(String[] args) {
        System.out.println("message");
        System.out.println("message");
    }
}
statement
A single command in a program.