Sunday, June 30, 2013

Standalone Java Application

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

  • The file name must be the same as the class name
  • To compile:  javac <filename.java>
  • Produces byte codes (not native object code).
  • Java Runtime (JRE) translates byte code to machine code at runtime
  • To run: java <filename.java>
To create a Java applet for the browser, create a class that exends JApplet