Take a look at this
byte 1 signed byte (two complement). Covers values from -128 to 127. short 2 bytes, signed (two complement), -32,768 to 32,767 int 4 bytes, signed (two complement). -2,147,483,648 to 2,147,483,647. Like all numeric types ints may be cast into other numeric types (byte, short, long, float, double). When lossy casts are done (eg int to byte) the conversion is done modulo the length of the smaller type. long 8 bytes signed (two complement). Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807. float 4 bytes, IEEE 754. Covers a range from 1.40129846432481707e-45 to 3.40282346638528860e+38 (positive or negative). Like all numeric types floats may be cast into other numeric types (byte, short, long, int, double). When lossy casts to integer types are done (eg float to short) the fractional part is truncated and the conversion is done modulo the length of the smaller type. double 8 bytes IEEE 754. Covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative).
Now you can understand if we will represent some floating and double values in others. part of the original number (floating or double) will be absent. therefore, casting is not possible in this case
source share