public class HelloWorld {

    public static void main(String[] args) {

        System.out.println("Hello, World!");

    }

}

Explanation:

1. Class Declaration: The program starts with a class declaration `public class HelloWorld`. In Java, every program must have at least one class, and the name of the class must match the name of the file containing the code.

2. `main` Method: Inside the `HelloWorld` class, we have a `main` method. The `main` method is the entry point of the program, and it is executed when the program is run. It has the following signature: `public static void main(String[] args)`. Here, `public` specifies that the method can be accessed from outside the class, `static` indicates that the method belongs to the class rather than an instance of the class, `void` means that the method doesn't return any value, and `String[] args` represents the command-line arguments passed to the program.

3. `System.out.println()`: This line is used to print output to the console. `System.out` is a reference to the standard output stream, and `println()` is a method of the `PrintStream` class that prints a line of text. In this case, we pass the string `"Hello, World!"` as an argument to `println()`, which will display the message "Hello, World!" on the console.

When you run this Java program, it will output the message "Hello, World!" to the console.