--- --- restore content begins
Concurrency: same time, same looting of public resources by multiple threads
Parallel: the same time, multiple threads together without disturbing each occurrence
hot key
ctrl + A select all
ctrl + z revocation
ctrl + s to save
ctrl + c to copy
ctrl + v to paste
Cut ctrl + x
JRE: JAVA runtime environment
JDK: JAVA Development Kit
First, keywords, reserved words
Keywords: have the right to do business
Reserved words: no key powers, but there are business keywords, the next version could escalate as the keyword.
1. The data for defining the types of keywords
class interface byte short int long float double char void
2. keyword is used to define the type of data value
true false null
3. define keywords for process control
if else switch case default while do for break continue return
4. keyword is used to define access modifier
abstract final static synchronized
The keyword for defining the relationship between classes and class
extends implements
6. The keyword is used to define and create an instance of a reference example, an example of determination
new this super instanceof
7. keywords for exception handling
try catch finally throw throws
8. A package for Keyword
package import
9. Other modifier keywords
native strictfp transient volatile assert
Second, the identifier
Identifier: is to give classes , interfaces , methods , variables, and other character sequence used when a name
Composition rules:
1. English uppercase and lowercase letters
2. numeric characters
3. $ and _
Precautions:
1. Do not start with a number
2. is not a keyword in Java
3. case sensitive
Third, comments
Note: The text for explanation of the program
1. Single-line comments
Format: // comment text
2. Multi-line comments
Format: / * comment text * /
3. Documentation Comments
Format: / * comment text * /
Fourth, variable
Variable: denotes a memory region, the region name (variable name) and type (range of the data). Variable name suggests: you can become constant, that is constantly changing variables can be stored in the same type of constant
Defining the variable format: Data type variable name-value = initialization ;
Fifth, data types
1. The data type classification
2. The basic data types
Numeric types: byte short int long float double
Boolean: only two values: true and false
Character type char: on behalf of a single character
Six, operator
1. The arithmetic operators
2. assignment operator
= , +=, -=, *=, /=, %=
3. Relational Operators
4. Logical Operators
The bitwise operators
6. The ternary operator
format
(Relational expression ) expression? 1: Expression 2;
If the condition is true, the result of operation is the expression 1;
If the condition is false, the result of operation is the expression 2;
Seven, flow control statements Classification
1. Sequence Structure
2. Select structure
3. loop structure
Eight, if statements
There are three formats if statement
1 species.
if (relational expression) {
Statement body
}
The second species.
if (relational expression) {
Statement 1;
}else {
Statement 2;
}
A third.
if (relational expression 1) {
Statement 1;
}else if (关系表达式2) {
语句体2;
}
…
else {
语句体n+1;
}
---恢复内容结束---