char to short Java

After knowing primitive data types and Java rules of Data Type Casting (Type Conversion), let us cast char to short. The short takes 2 bytes of memory and char takes 2 bytes of memory. Here, casting rules do not work as short can take a negative value where as char is always positive. The type …

char to short Java Read More »