A good answer might be:

Example Source Program

Here is the source program (source file) from the previous chapter. The purpose of this program is to type the characters Hello World! on the monitor.

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

The file must be named Hello.java to match the name of the class. On many computer systems, the upper and lower case characters of the file name are important. (So if the file is named hello.java with a small h it will not work). On all computers, upper and lower case inside the program are important. The first line ...

class Hello

... says that this source program defines a class called "Hello". A class is a section of a program. Small programs often consist of just one class. (A better definition of "class" will be given in a later chapter.) When the program is compiled, the compiler will make a file of bytecodes called "Hello.class".

Some classes contain many lines. Everything that makes up a class is placed between the first brace ( { ) and the matching last brace ( } ).

The name of the class (and therefore the name of the file) is up to you. The name must be made of alphabetical characters and digits. The first character must be alphabetical, and no spaces are allowed inside the name. Usually class names start with a capital letter, but this is not required. The source file should always end with ".java" in lower case.

QUESTION 2:

Here is the first line of a Java program:

class AddUpNumbers
  1. What should the source file be named?
  2. What will the compiler automatically name the bytecode file?