We write, compile and run the first program on java

Опубликовано: 20 Ноябрь 2026
на канале: JavaLight
270
4

The functionality of this program is quite trivial - it prints the words "Hello Java !!!" in the terminal.

To write the code, we use the simplest editor that is available. We call the file "Hello.java".

Let's enter the following code:

Class Hello {
Public static void main (String args []) {
System.out.println ("Hello Java !!!");
}
}

The string System.out.println ("Hello Java !!!"); This command displays a string, in this case - Hello Java !!!.

Save the file. Let's go to the terminal in the folder where the file is located and execute the command - javac Hello.java to compile.

Run, after compilation, java Hello.
We see in the terminal our line.