Five elements named by a variable
- Consists of letters, numbers, "_" and "$"
- The first letter cannot be a number
- Case sensitive
- Cannot use Java reserved words and keywords
- Can be named in Chinese, but it is not recommended
II. basic data types for Java
- Integer type: Byte, short, int, long
- Float type: float, double
- Character type: Char
- Boolean Type: Boolean
Iii. three elements of circulation
- Initialization of a cyclic variable
- Conditions of the cycle
- Changes in cyclic variables
Four, array
An ordered set of data sources called arrays
Characteristics:
- The array must be made up of a collection of the same elements
- Arrays are ordered linearly, and each element has its own unique precursor element except for the first element, and each element has its own unique successor, except for the last element.
- Array elements can be accessed by a unique subscript, with the subscript starting from 0
V. Methods
method is used to encapsulate a piece of code that has a specific function, independent logic.
Five Elements of the method:
- Modifier (public, private, protected, static, final)
- return value type
- Method name
- Parameter type
- Method body (can be omitted)
Vi. what is the function of return in the method?
In a method that has a return value, returns a value of the specified type.
In a method that has no return value (void method), it is used to end the operation of the current method, that is, the terminating method.
Java Conceptual issues