no of bytes for int code example
Example 1: int to byte
int i = 234;
byte b = (byte) i;
System.out.println(b); // -22
int i2 = b & 0xFF;
System.out.println(i2); // 234
Example 2: how manz bytes int
An int has a size of 4 bytes
int i = 234;
byte b = (byte) i;
System.out.println(b); // -22
int i2 = b & 0xFF;
System.out.println(i2); // 234
An int has a size of 4 bytes