In the calculations, all the numbers! Just bits and bytes.
int , char , byte , short and long are just numbers. A char is just a number the compiler knows, usually used to display a character represented by a specific number (e.g. 32 = space, 48 = zero, etc.).
A string is a sequence of numbers and other things, so itβs a bit more complicated. We do not want to go there.
An int is a four-byte number, and char is a two-byte number, so you can put any char number in int .
The Java designers simply decided that they would let you convert from char to int without any special tricks or conversions.
source share