Java has three types of integer literals:
- decimal: 123, 345, 3764632, ...
- octal: 012, 0345, 076, 012, ...
- hexadecimal: 0xF4E3, 0XABDC, 0x0254, ...
Note that:
- decimal literals are composed of digits from 0 to 9 where the left-most digit cannot be 0.
- octal literals always begin with a 0 followed by digits ranging from 0 to 7
- hexadecimal literals always begin with 0x (zero lowercase x) or 0X (zero uppercase x) followed by digits ranging from 0 to 9 and letters ranging from A to F (upper- or lowercase letters)
[ July 11, 2002: Message edited by: Valentin Crettaz ]