The first Java program

  1. Create a new hello.java file

  2. Write code:

    public class Hello{
    	public static void main(String[] args){
    		System.out.print("Hello,World!"); }}Copy the code
  3. To compile the code: CMD to hello. Java file path, enter the command: javac hello. Java, generate hello. class file

  4. Run the class file: type: Java Hello, see Hello,world!

Compiled, interpreted