A Java method is a set of Java statements which can be included inside a Java class. Java methods are similar to functions or procedures in other programming languages.

Every Java program must have one main() method.

Here is the main() method from a Java program which prints "Hello World":

 public static void main (String[] args) {
   // This Java program prints "Hello World!"
   System.out.println{"Hello World!");