Java Byte type

Java Byte type


Byte Type in Java
This data type can store numbers from -128 to 127. This can be used instead of int or other integer types when the given value is taking 1 byte space.
We can use (byte) method to convert any other data type into byte type we will see an example as follows - 
int a = 32;
byte num = (byte)a;
System.out.println(num);