Previous data types are not clear, later work needs, the TCP protocol to send data, to account for a few bytes of several bytes, the circle, thoroughly to tidy up.
Java explicitly defines the specific data type for each data type, and different data types occupy different memory spaces.
Data type: base data type, reference data type
Basic data types: numeric, character (char), BOOL (Boolean)
Numeric type: integer type (byte, short, int, long), floating-point type (float, double)
Reference data types: Classes (Class), interfaces (interface), arrays ([])
This is the classification of some data types, basically no use, summed up a commonly used simple data except that the array is the basic data type, the others are referenced.
The integer default is int, and the decimal number defaults to double.
The most commonly used is the following occupied memory space:
Byte 1 bytes
Short 2 bytes
Char 2 bytes
int 4 bytes
Float 4 bytes
A long 8 bytes
Double 8 bytes
Kanji 2 bytes
Apart from this, there is a mutual conversion.
Byte--short--int--long--float--double
Char--int--long--float--double
From left to right is from low type to high type, conversion is auto-conversion, reverse requires casting
For example: short a = 1;
int b = A;
int c = 1;
Short d = (short) C;
Java underlying data type related