The first Java program
-
Create a new hello.java file
-
Write code:
public class Hello{ public static void main(String[] args){ System.out.print("Hello,World!"); }}Copy the code
-
To compile the code: CMD to hello. Java file path, enter the command: javac hello. Java, generate hello. class file
-
Run the class file: type: Java Hello, see Hello,world!
Compiled, interpreted