a is of type char , and characters can be implicitly converted to int . a is represented as 97 because it is the code point of small latin letter a .
System.out.println('a'); // this will print out "a" // If we cast it explicitly: System.out.println((int)'a'); // this will print out "97" // Here the cast is implicit: System.out.println('a' + 0); // this will print out "97"
The first call calls println(char) , and the other calls println(int) .
Related: What is encoded Java char stored in?
source share