First program and knowledge of java learning, first program of java Learning
I have also read a series of java programs before, but I have not officially typed them. Today I officially learned and typed out the code. Here we will record the daily income
Writing Tool: Notepad ++
Many people suggest using Notepad for writing tools, but I still think it is better to use Notepad ++ as an editing tool.
First Program
public class HelloWorld{ public static void main(String []args) { System.out.println("Hello World!"); }}
Let's analyze this program:
Execution Program
After the program is written, it is saved as a file with the suffix of java. We will illustrate this path.
E: \ java_lianxi \ TwoDay \ HelloWord. java
Note that the name of the saved file must be of the same type as that modified by public in the file. According to the code example above, the file name is HelloWorld. java.
After saving it, it is executed. Let's take a look at the java execution process.
In start -- run -- input cmd, run
Use the cd command to adjust the current location to the folder where the java source code file is located. If you do not need to use the cd command to switch the drive letter, enter the drive letter with a colon.
After the current location, you can run the javac command. After the javac command is executed, the HelloWorld. class file is generated,When executing this command, the file should be suffixed with a suffix
Then run the java command. Do not add a Suffix in java HelloWorld.
At this point, the first program is executed.
The following describes java features.