1. Variables: In Java, we describe variables by three elements: variable type, variable name, and variable value
Note: The punctuation in Java is in English
2. Variable name = First Letter + remainder
Letters, + Letters
Underline, number
$, underline
$
Note: Variables cannot start with a number
Cannot start with a special character other than an underscore, $ character
cannot be a Java keyword, reserved word
Good siege master habits: When the variable name consists of multiple words, the first letter is lowercase, then the first letter of the word is capitalized, and the hump is named
When a variable is named, it should be known
Java variable names are not limited, but the Java language is case-sensitive
3. Data type integer type in Java (Byte,short,int, long)
Base data type numeric floating-point type (float,double)
Character type (char)
Boolean Type (Boolean)
Data type
Reference data type classes (Class)
Interface (interface)
Array
Note: The data itself is stored in the basic data type variable
The spatial address of the data stored in the reference data type variable
String is a common reference data type that is used to represent a string
Rules for the use of variables in 4.java
Variables to be declared before use
When a variable is used, it can be initialized at the same time as a variable, or it can be declared and then assigned
Variable can only assign one value at a time
The variables defined in the main method must be assigned first to output
Variable names are not recommended for use in Chinese and are garbled during later cross-platform operations
5. Automatic type conversion in Java
6. Forced type conversion in Java ()
7. Application of Constants in Java
8. How to use annotations in Java
Introduction to Java first season 2