Java data type, java Basic Data Type
1. Basic types: 8
Number: INTEGER: byte 1 byte (-128 to 127) one byte occupies 8 bits 1bit =
Short: 2-byte short integer
Int: integer 4 bytes
Long: 8-byte long integer
Float: 4-byte float: * 7 digits
Double: double Floating Point type, 8 bytes // ******* valid number sixteen
Non-numeric type: boolean indicates the logical type. Values true and false are false.
Character Type: char: represents A single character, 1 byte, and the value is included in ''. For example, 'male' '1', 'A', A single Chinese character, letter, and number are supported.
2. reference types: Three
Class type (Packaging class (String is a special packaging type), custom type, JDK built-in class)
Interface Type
Array type
Enumeration type
3. type conversion:
Automatic conversion: the type with low precision can be automatically converted to a type with high precision.
Forced conversion: converts a type with high precision to a type with low precision to a forced conversion with a loss of precision.
4. in java, common data types range from small to large (precision from high to low): byte <short <char <int <float <double.
5. Forced conversion of data types:
1). the string type and int or long type are converted according to the ASCII code table.
Syntax format (char) 97; (int) 'A'; (long) 'B ';
(The lowercase letter range is 97-122, and the upper-case letter range is 65-90)
2). Small-to-large conversion between numeric models, automatic conversion, large-to-small conversion, forced conversion