1. First download the development tool
: Http://www.oracle.com/
Windows x86 |
88.35 MB |
Jdk-7u9-windows-i586.exe |
The version is updated all the time, so the latest version is generally downloaded! (Select x86 for 32 systems)
2. install and configure the environment
Follow the prompts to install it. If you do not understand it for the first time, install it all. After the installation is complete, click "Computer properties" and find the environment variable settings, as shown below:
A. Create an environment variable JAVA_HOME,
Find the path where you just installed java. My path is: D: \ Program Files \ Java \ jdk1.7.0 _ 07.
B. Find the Path environment variable for editing (note that you must add it before the existing value of Path to prevent multiple versions from being installed). Edit the variable as follows:
3. After the system environment of the development tool is set, test whether the installation is successful. Run cmd + R, Enter cmd, and enter java-version in the Command window. A version prompt is displayed, indicating that the installation is successful.
4. Compile the classic HelloWorld (using notepad or UItraEdit) and save the file name Hello. java (note that the file name must be the same as the class name in the following code)
The Code is as follows:
public class Hello{public static void main(String[] args){System.out.println("Hello Java world");}}
5. Compile and run the command: run the cmd command to find the directory where you saved Hello. java. Enter the following command:
6. Congratulations, you can start your java learning journey!
========================================================== ====================================
String comparison
A: Use "=" to compare the address value.
B: Use equals to compare the specific content.
If an internal class is declared with the static keyword, the internal class becomes an external class and can be accessed directly through the external class.
In java, only single inheritance is allowed, and many inheritance are not allowed. That is, a subclass can inherit only one parent class (C # is the same, and must inherit more through interfaces)
Super keyword. You can directly access the attributes, parent class constructor, and methods of the parent class.
Super. ()
Final keywords, Declaration class, attributes, Methods
A. Declare a class, and no subclass is allowed.
B. Declare a method, so the quilt class cannot overwrite it.
C. Declare an attribute and change it to a constant. No value can be assigned.
The variable declared by static final is a global constant.
Abstract class, which cannot be directly instantiated; it must have a subclass
The interface can be understood as a special class, which is all composed of global variables and public abstract methods. (Interface Keyword: implements)
The interface must also have subclass, And the subclass must implement all the methods of the interface.