An integer literal is expressed in decimal (base), hexadecimal (base), octal (base 8) , or binary (base 2).
int decimal = ten; int hexadecimal = 0x10; int octal = 010; = "Ten"; System.out.println (decimal); // Ten SYSTEM.OUT.PRINTLN (hexadecimal); // - System.out.println (octal); // 8 // 2
Hex starts with 0x
Octal starts with 0
No binary numbers
Values are represented in 10 binary
How hexadecimal numbers are read
0 1 2 3 4 5 6 7 8 9 A B C D E F
Sample 1
0X10 read as a zero fork 10, can not be read as a zero fork 10 (decimal notation can not be applied to hexadecimal causes confusion); cannot be read as a zero Fork 16 (16 is its corresponding 10 binary value)
Sample 2
16 binary 11 means decimal is 17.
A hexadecimal representation of a decimal is 17.
The easy-to-understand system is decimal, which is used in decimal notation.
Java 2 8 10 16