Basic data type:
First, the numerical type1) Integer:1, byte a byte, 8 bits, the value range 0~255, for storing binary data. 2, short two bytes, 16 bits, the value range is between -32768~32767. 3, int four bytes, 32 bits, value range is between -2147483648~21474836484, long eight bytes, 64 bits, the value range is 9,223,372,036,854,775,808 ~9,223,372,036,854,775,8072) floating point type:1, float, four bytes, single-precision floating-point number with a range of -2^128
~ +2^1282, double, eight-byte double-precision floating-point number with a range of -2^1024
~ +2^1024second, character type: Char, a set of data setsThree, Boolean: Boolean, only two values, one true, one falseFour, Strings: string,Basic Data type conversions:low to advanced can be converted automaticallychar→int→long→float→doubleByte→short→intForced Conversionsdouble num1=78.2;int num2= (double) Num1
Basic data types for the Java Foundation