1. Data type:
Eight basic data types: integer byte, short, int, long (1, 2, 4, 8 bytes), float float, double (8, 16-bit valid number), cloth boolean character Char
Three large reference data types: objects, interfaces, arrays
2. Automatic type conversion and forced type conversion:
Auto: int a;byte b;a=a+b; here, B is 1 bytes and can only be shifted to a high byte int participating operation
Note : Byte b;b=b+5; This is an error, because 5 is the int,int+byte can only be calculated by int, after the matter has become an int, so can not be directly assigned to the byte type B
Mandatory: Connect the b= (byte) b+5;
3. Arrays
How to define:
A. Element type [] Array name =new element type [size]
int[] arr = new INT[5];
Note : The element type can be an object
B. Element type [] Array name =new element type []{element 1, element 2 ...}
int[] arr = new int[]{3,5,1,7};
Int[] arr = {3,5,1,7};
Two-dimensional arrays
int[][] arr = new int[3][2];
int[][] arr = new int[3][];
Int[][] arr = {{1,2,3},{1,2},{1,2,3,5}};
Java Basic Knowledge Collation