java 0x

"0x" is a prefix for hexadecimal numbers in Java. In Java, if an integer value starts with 0x or 0X, it means it is a hexadecimal number.

For example, the following code fragment assigns the integer 10 to the variable x:

int x = 0xA;

In this example, 0xA is a hexadecimal number whose decimal value is 10. Therefore, the value of x will be 10.

The integer types supported in Java include byte, short, int, long and other types. These types can be initialized and manipulated with hexadecimal values.

Guess you like

Origin blog.csdn.net/fromVillageCoolBoy/article/details/129866887