There are 8 basic data types defined in the Java language to hold variables. Java requires each variable in the program to specify its own type. Because of this, Java is a strongly typed language that differs from a weakly typed scripting language such as JavaScript.
8 Different types:
Byte:8 bits, the maximum amount of storage data is 255, the stored data range is between -128~127.
Short:16 bits, the maximum data storage is 65536, the data range is -32768~32767.
Int:32 bits, the maximum data storage capacity is 2 of the 32-bit minus 1, the data range is negative 2 of 31 times to positive 2 square minus 31.
Long:64 bits, the maximum data storage capacity is 2 of the 64-bit minus 1, the data range is negative 2 63 times to positive 2 square minus 63.
Float:32 bit, the data range in the 3.4e-45~1.4e38, the direct assignment must be in the number after the addition of F or F.
double:64 bit, data range in 4.9e-324~1.8e308, the assignment can be added D or D can also not add.
Boolean: Only True and false two values are taken.
Char:16 bits, storing Unicode codes, and assigning values in single quotes.
Data type JAVA