Java’s first cry "Hello, World!"

Java’s first cry "Hello, World!"


  1. Create a new .Java file
  2. Code such as:
public class Hello{
    
    
	public static void main(String[] args){
    
    
		System.out.print("Hello,World~");
	}
}
  1. In the code path folder, add a cmd space in front, and open the Java path in cmd.
  2. Input javac.java file (need to add the suffix class), compile the code to generate class file.
  3. Enter the java class file (no need to add the suffix class) and run the code.
    Hello,World!

Guess you like

Origin blog.csdn.net/qq_39453420/article/details/108087713