I. Three major mechanisms
1. JVM
Acts as a translator and translates. class files into commands that can be read by the underlying operating system to implement cross-platform Functions, shielding different underlying operating systems
2. Garbage Collection Mechanism
ProgramThe user does not need to care about memory management, and the spam will be automatically recycled.
The garbage collection time is not fixed. Instead, garbage collection is performed in a timely manner.
System. GC ();
Runntime. GC ();
3. bytecode validator
Semantics: whether the. Class file is damaged or whether the data type matches
Whether the stack overflows ....
Ii. Naming rules
1. Class Name and Interface Name: the first letter of each word is capital class myfreind interface weacpon
2. Fields, methods, and objects: lowercase letters of the first word, and other upper-case Boolean iswoon
3. Package name: All use lower case letters
4. constants: all are in uppercase.
Iii. Data Types
Two big data types in Java:
1. "Raw" (basic) data types used for scientific computing
Byte (8-bit) Short (16) int (32) Long (64)
Float (32) double (64) Char (32) Boolean
Note: Char and INT have the same length and can use char c = 'a'; int B = C + 12;
2. Reference data types used for Java surface object programming;
Reference Type)