When you write
int answer = 42; System.out.println(answer);
The int value stored in the answer variable is converted to String and then displayed on your monitor. The same applies to displaying a value in your IDE debugger. In the end, all numeric data is converted to ASCII (or some other character encoding) to display it. This is true in any programming language.
Now we may wonder how this transformation happens. By default, int converted to decimal. This is what most people use to read and expect to see. As programmers, we sometimes need to think about the hexadecimal representation of the int value, for example, in your code. However, the computer does not automatically know about it just because we set the value of the variable using the hexadecimal representation. In particular, your IDE still displays all int data in decimal notation by default.
Fortunately, IDE designers are programmers and understand that sometimes we need to see int data in a different form. You can change the settings for your debugger to display int data as hexadecimal. Since the steps for this depend on your IDE, you should check the help files for details.
source share