search
Login

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
13 views
asked Guru 27.1k points 31 50 97

1 Answer

0 votes
The following table shows the format specifiers:

Format Specifier    Conversion Applied
%a %A                 Floating-point hexadecimal
%b %B                 Boolean
%c                        Character
%d                         Decimal integer
%h %H                Hash code of the argument
%e %E                Scientific notation
%f                         Decimal floating-point
%g %G                Uses %e or %f, whichever is shorter
%o                         Octal integer
%n                         Inserts a newline character
%s %S                  String
%t %T                      Time and date
%x %X                      Integer hexadecimal
%%                          Inserts a % sign

If the argument doesn't match the type-checks, an IllegalFormatException is thrown.
answered Expert 15k points 15 23 30

Related questions

0 votes
1 answer 50 views
50 views
asked john Guru 27.1k points 31 50 97
0 votes
1 answer 20 views
20 views
asked john Guru 27.1k points 31 50 97
0 votes
1 answer 19 views
0 votes
1 answer 58 views
58 views
asked taye Sr Member 5k points 7 9 12
0 votes
1 answer 26 views
26 views
asked felin Advisor 8.4k points 10 15 18
...