The theoretical stuff is not recorded in the notes.
First to explain the Java installation process some problems, Java installation and environment configuration is not much to emphasize, you can refer to the first part of Http://www.cnblogs.com/JianXu/p/5158404.html, Configure the JDK environment variables for the configuration of the Java environment variables.
1.JDK and JRE
In the Java installation process, we will actually find that we are equivalent to install two programs, one called "JDK", the other is called "JRE", including the configuration of Java environment variables are also, with the match, we configure the JDK and JRE.
So, the question is, what is the JDK and the JRE doing? You can understand that the JDK is the Java Development program, and the JRE is the Java running program. Is that a lot of clarity? Of course, if you are just developing, you can only download the installation configuration JDK, if you just run, you can just download the installation configuration JRE. But in fact, I think no one should do this, because we need to debug ourselves in the development process to run our own developed programs. So two of them are better to install. In fact, when we download the JDK is included in the download of the JRE, of course, as a mere user can only install the JRE is allowed.
2. HelloWorld of the first Java program
Create a new Notepad named HelloWorld, suffix. txt to. java, and then use Notepad to open the Helloworld.java file, and then enter:
Public class helloworld{ publicstaticvoid main (string[] args) { System.out.println ("helloworld!" ); }}
Note:
1) After class HelloWorld called the class name, the class name must be the same as your file name, that is, the previous creation of the Notepad was later renamed to HelloWorld
2) A file can only have a public class, but there can be more than one class class, in the Javac compilation process, your. Java has several classes that generate several. class files, and the. java file name must be public The class name that is behind class
3) public static void main is our main method and is also the execution entrance of the program
4) System.out.print ("") is output and must have a semicolon at the end of each statement
5) Java is strictly case-sensitive, in addition to the content you want to output other must follow the appropriate casing rules
Then the editor runs (for example, your helloworld.java is stored in the D-packing directory)
1) Open the cmd command line, enter "D:" and then enter, switch to D-Drive
2) Enter the command "Javac Helloworld.java" and then enter, after the completion of the program you should have a directory called Helloworld.class file (compile)
3) Continue to enter the command "Java HelloWorld" (run) and then enter, this time the interface should be output HelloWorld
3.java Annotation Method 1) Single line comment
//
2) Multi-line Comment
/*
Multi-line comments
*/
3) Multiline Comment 2
/**
* Multi-line comment, and can be parsed by doc
*/
First, knowledge of Java