The content behind the 1.public class must be the same as the source file name;
2.java language case sensitive (for example, void is a keyword and void is not);
3. Identifiers: Can consist of letters, numbers, underscores (_), and dollar signs ($) (but cannot start with a number), and cannot contain other special characters such as spaces;
4. Describe the three elements of a variable: variable type, variable name, variable value;
5. Define a variable of string type: string words = "I love u";
Concatenation of strings and variables with +: SYSTEM.OUT.PRINTLN ("The content of the variable is:" +words);
6.java variable name No length limit, composed of more than one word, the first letter is lowercase, the rest of the word capitalized, such as numofstudents (hump naming law);
7.java Data type:
String type with double quotation marks;
8. It is not recommended to name variable names in Chinese, so it is easy to generate garbled characters;
9. Automatic type conversion in Java: Condition 1. The target type is compatible with the original type, such as double and int compatible, and int and char are incompatible; the target type is greater than the original type, for example the double type is 8 bytes, the int is 4 bytes, so the int type can be converted to double type;
Forced type conversions in 10.java:
Operation Result: 75.8
75
Because it is not rounding but directly to the fractional part, so it is easy to cause data loss.
1. Beginner Java