float to short Java

After knowing primitive data types and Java rules of Data Type Casting (Type Conversion), let us cast float to short. The float takes 4 bytes of memory and short takes 2 bytes of memory. Assigning 4 bytes of memory to 2 bytes of memory requires explicit casting. Moreover, float takes a mantissa (float-point value) but …

float to short Java Read More »