Java language Overview:
Do not give language bondage, mainly learn to develop ideas, language is a tool
In the company's main learning is the development process
Java is a compiled language:
Compiled languages: Need to be compiled to run
Interpreted language: a process that does not require compilation to run directly
Java is not a dynamic language:
Dynamic Language: JavaScript
Example:
Java:int a=100;
A= "Hello World";//Error
Js:var a=100;
A= "Hello World";//Correct
Java has three systems: Javase (now Learning) Java EE (web) javame (Android)
Java is a cross-platform language: once compiled and run everywhere.
Based on a JVM (virtual machine), virtual machines Ensure that Java programs are cross-platform
Xxx.java during compilation Xxx.class
Question: Why Java is a cross-platform
A: Java virtual machines are not cross-platform, and Xxx.class can be run on virtual machines in different versions.
Java is an object-oriented language:
Start with the object everything is an object
Example:
Refrigerator:
Process-oriented: function (open) function (off)
Object-Oriented: object. Open object. Close
Environment Preparation:
1. Download the virtual machine
2. Install the virtual machine
JDK: Can be used for Java development Java run (contains JRE)
Jre:java Runtime Environment (contains virtual machine Core class library)
3. Configure Environment variables:
Java_home: Put Java home directory such as: C:\Program files\java\jdk1.7.0_07
Path: Run the program such as: C:\Program Files\java\jdk1.7.0_07\bin
CLASSPATH: The location of the core class library tells the JRE where to find the running class library
%java_home%/lib/dt.jar;%java_home%/lib/tools.jar
It is best to set it in the system environment variable, which is valid for all users.
How to prove that the environment is configured: Enter Java javac in cmd
View Java version: Java-version
Java's first applet:
Hello World
Java class name and Java file name requirements are consistent
Entry point of the program: Main method
To compile before running: run in cmd
Compile: Javac xxx.java--->xxx.class compiled byte code
Run: Java XXX
Eclipse Green's Software
Java language Overview