You should have already installed Java Development Kit (JDK).
Let us begin by writing our first Java program that prints a message "Hello, world!" to the display console, as follows:
Step 1: Write the Source Code: Enter the following source codes using a programming text editor (such as TextPad or NotePad++ for Windows or gedit for UNIX/Lunix/Mac) or an Interactive Development Environment (IDE) (such as Eclipse or Netbeans - Read the respective "How-To" article on how to install and get started with these IDEs).
Do not enter the line numbers (on the left panel), which were added to help in the explanation. Save the source file as "
Hello.java". A Java source file should be saved with a file extension of "
.java". The filename shall be the same as the classname - in this case "