I'm new to Java and I learned that char in java is actually int, so we can do
char c = 'a';
int i = c; // i =97, which is the ascii index of letter "c"
However, when I tried to convert a char to byte, I obtained the same result:
char c = 'a';
byte b = (byte)c; // b =97
I know that in Java, a char is represented by 2 bytes while a byte is represented by a single byte.
Is this always the case that converts a char to int or to byte gives the same result? Why so then?