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

  • All code is contained within a class.
  • The file name must match the class name
  • The file name have a .java extension
  • All statements are contained within a method,
  • in this case named main().
  • All other statements are terminated with a semi-colon (;).
  • Java language is case-sensitive!
  • HelloWorld is not the same as helloworld,
  • String is not the same as string.
(c) Shilpa Sayura Foundation 2006-2017