Basic data type
- Integer byte short int long
- Float double
- Character char
- Boolean boolean
notes: - String is not a basic data type, but a reference type
- Floating point may only be an approximate value, not an exact value
- The data range is not necessarily related to the number of bytes. The float data range is more extensive than long, but float is 4 characters, and long is 8 bytes
- The default type of floating-point numbers is double. If you must use float, you need to add a suffix F; if it is an integer, the default is int type. If you must use the long type, you need to add a suffix L. Capital letter suffix is recommended.