Public class HelloWorld {
Public static void< Span class= "Hl-code" > main ( String[] Args {
< Span class= "Hl-code" > system.out. Println ( "hello World )
< Span class= "Hl-code" > }
< Span class= "Hl-code" > } /span>
Note: String args[] and string[] args can be executed, but it is recommended to use the string[] args, which avoids ambiguity and misreading.
1. Compiling Java files
If you are compiling a Java file in the cmd command window,
1) You can use input: Javac Helloworld.java
2) Run Java file: Java HelloWorld
2. Perform Java command parsing:
Javac: Write the file name of the Java file, for example: Helloworld.java, which is used to compile the Java file into a class bytecode file, after the command is successfully run, If normal compilation occurs, the Java file directory will appear with the same name as the Java file but with the suffix. class file.
java: followed by the class name of the Java file, HelloWorld is the class name of the Helloworld.java file, only the class name of the Java file is required.
1.java understanding of main function