Comments
---> Single line comments
/* */---> Multiline comments
/** */---> Documentation notes, Java-specific
Identifiers (Definitions of variables, methods, class names, package names)
Define rules: 1. Consist of letters, numbers, underscores, and $, but cannot start with a number
2. Cannot be a keyword in Java
Principles of definition: legibility, words too literally
Variable
The essence is a piece of memory area
Three elements: type, name, scope
Type determines the size of its storage area
Rule: 1. Variable must have a definite type
2. Variables must be declared and initialized before they can be used
3. Variable can be assigned value change
4. Variable has a definite scope, leaving the scope for immediate recycling
5. In the same scope, variables cannot be defined repeatedly
If you violate the above rules, a compilation error will occur.
Process Control with C language
If Else
For loop
While
Do While
8 Basic data types
4 Kinds of plastic:
Byte 1 bytes
Short 2 bytes
int 4 bytes
Long8 bytes
2 types of floating-point type
Float4 bytes
Double8 bytes
Boolean type
Boolean 1 bit
Character type
Char 2 bytes
Compound (Reference) type
objects, interfaces
Java Basic syntax