int to short Java

After knowing primitive data types and Java rules of Data Type Casting (Type Conversion), let us cast int to short. The int takes 4 bytes of memory and short takes 2 bytes of memory. Assigning 4 bytes of memory to 2 bytes goes by explicit casting where Programmer should do by himself. byte –> short …

int to short Java Read More »