One: JRE and JDK
JRE (Java Runtime Environment Java Run environment): jvm+ class Library
JDK (Java Developmen Kit Java Development Kit): JRE + Java Development tools
Another: Although Java is a cross-platform, the JVM is not a cross-platform
II: Configuration of the PATH environment variable
1. Create a new variable name; java_home
2. Add variable values for Java_home: JDK installation directory
3. Modify the JDK directory in the PATH environment variable%java_home%\bin;
Three: The difference between path and classpath
1.path environment variables are documented executable files, such as the. exe file, to the executable file in the current path to find, if not found to go to the path of the paths configured in the environment variable to find the 2.classpath environment variables are recorded in the Java class running file is located in the directory Four: Keyword 1. Features: The letters that make up the key are all lowercase 2. Caveats: Goto and const exist as reserved words
Define keywords for data types |
Class |
Interface |
Byte |
Short |
Int |
Long |
Float |
Double |
Char |
Boolean |
void |
|
|
|
|
Keywords that define data type values |
True |
False |
Null |
|
|
Define the keywords for process Control |
If |
Else |
Switch |
Case |
Default |
While |
Do |
For |
Break |
Continue |
Return |
|
|
|
|
Keyword that defines the access permission modifier |
Private |
Protected |
Public |
|
|
Defines a keyword for a class, function, variable modifier |
Abstract |
Final |
Static |
Synchronized |
|
Keywords that define relationships between classes and classes |
Extends |
Implements |
|
|
|
Define an instance and reference instance to determine the keyword of the instance |
New |
This |
Super |
instanceof |
|
Keywords for exception handling |
Try |
Catch |
Finally |
Throw |
Throws |
The Package keyword |
Package |
Import |
|
|
|
Other modifier keywords |
Native |
Strictfp |
Transient |
Volatile |
Assert |
Five: Identifiers
Composition rule:
- English uppercase and lowercase letters
- numeric characters
- $ and _
Precautions:
- Cannot start with a number
- Cannot be a keyword in Java
- Case sensitive
Common Naming conventions:
- Package-------------All lowercase
- Class or interface-----capitalize the first letter of each word
- method or variable----start with the second word, capitalize the first letter of each word
- Constant------------uppercase, separated by _
Six: Binary
- Binary: Consists of 0, 1. Start with 0b
- Octal: by 0,1,... 7 composition. Start with 0.
- Decimal: Made up of 0,1....9.
- Hexadecimal: Made up of 0,1...A...F. Start with 0x
Conversion techniques between the binaries:
- Binary to octal: three-bit combination, left not enough to fill 0, will be asked for 10 binary data combination
- Binary to 16 binary: four-bit combination, left not enough to fill 0.
Seven: About shift
Since the computer operates the complement, the moving binary can also be seen as the original code shift for positive shift
EG:3<<2 (3 left shift 2 bit, 3*2^2=3*4=12)
If a negative number shifts, you need to calculate the complement.
Eight: Method overloading:
In the same class, the method name is the same, and the parameter list is different. Regardless of return value
Java Basics (i)