Use cmd command window to compile and output Java-HelloWorld

HelloWorld-Java

Enter cmd at the top of the address bar of the Hello.java folder and press Enter to open the cmd command box in the current directory
Insert picture description here

Enter javac Hello.java in the opened cmd command box to compile the java code and generate a Hello.class file in the directory.
Then continue to enter java Hello in cmd to output HelloWord!
Insert picture description here

public class Hello{
    
    
	public static void main(String[ ] args){
    
    
		System.out.print("Hello,World!");
	}
}

Guess you like

Origin blog.csdn.net/qq_44923507/article/details/109164336