1. Basic Data Types
No memory allocation issues involved. It is divided into eight types: Byte, short, int, long, float, double, char, Boolean, respectively. The default values are as shown in the figure:
2. Reference data type
Developers are required to allocate space for them. It is divided into three kinds, namely array, class, interface. The default values are as shown in the figure:
* * Personal selection data type principle (99% General):
* * If you want to represent integers, use int, which means decimal is used, if you want to describe a date-time number or a file (or memory) size with long, if you want to implement content transfer or encoding conversion using Byte, you can use Booleam if you want to implement logical control; If you want to use Chinese, use char to avoid Chinese garbled; If you follow the Save range: Byte < int < long < double;