Java Reference
In-Depth Information
The meaning of flags, width, and precision is similar for the different
conversions but the details differ depending on the exact kind of con-
version, as discussed in the following sections.
When you consider which argument types are expected for each con-
version, remember that anything that applies to a primitive type also
applies to its wrapper. For brevity we don't mention the wrapper classes
explicitly.
22.1.2. Integer Conversions
The integer conversions apply to arguments of type byte , short , int , and
long . The different conversions are
d decimal format
o octal format
x , X hexadecimal format
The width value specifies the minimum number of characters to out-
putincluding additional characters that the flags may cause to be in-
cluded. No precision value may be given. The flags applicable to each
conversion are shown in the following table. An entry with a x means
the flag is not allowed.
Flag
x/X
Meaning
d
o
Left justify (otherwise
right justify)
'-'
Include radix: 0 for octal
and 0x or 0X for hexa-
decimal
'#'
x
 
Search WWH ::




Custom Search