Java learning notes 1 (HelloWorld), learning notes helloworld
Writing HelloWorld is a ceremony:
1. Download and install JDK. Note that no Chinese characters exist in the path.
2. Add environment variables and bin directory
3. Write a text with the following content and the suffix changed to. java. Note that the text name is HelloWorld and cannot be changed.
Public class HelloWorld {
Public static void main (String [] args ){
System. out. println ("HelloWorld ");
}
}
4. Compile after writing:
Open cmd To Go To The java file directory, and then: javac HelloWorld. java
A class file is generated, and then: java HelloWorld
Successful!
Additional:
Some common doscommands:
1. Open: win + R Enter cmd
2. Return to the upper-level Directory: cd ..
3. Return the root directory: cd \
4. Enter a directory: cd name
5. Switch the drive letter: cd d:
6. Combination: cd d: \ name (remember to change the drive letter)
7. Show All contents in the current directory: dir
8. Clear screen: cls
9. Check ip: ipconfig