5.8.5. Java programs

Write a java program in a file whose extension is .java. For example, you might write assignment 1 in a file called assn1.java.

A java program starts with any imports that you want, then defines a public class whose name is the same as the name of the file that contains it, with .java Put a main method in that class. For example, a full Java program might look like this.

import static java.lang.System.out;

public class Hello
{
  public static void main(String[] args)
  {
    out.println("Hello");
  }
}
That would need to be in a file called Hello.java.