1. Variable format: variable name of data type = initialization value;
Class Name Object name =new class name ();
2. Reference data type class interface array
3. Automatic conversion of data type conversions
Cast: int i= (int) 1.5
4. Method: is a piece of code, you can complete a specific function
Can be called repeatedly to improve the reusability of code
Modifier return value type method name (parameter list) {code ... }
5. Loop structure for (initialization expression; Boolean expression; stepping expression) {loop body}
While
6. Array array type [] array name =new data type [length]
Array type [] array name =new data type []{element 1 .... } data type [] array name ={element 1 ... }
7. Create object class name Object name =new class name ();
8. Constructor method Modifier constructor Method name (parameter list) {method body}
9. Inheritance modifier abstract return value type method name (parameter list)
10 Abstract Class class name
11. Interface public interface Name {}
Java Basic Syntax Essentials Summary