The Format Family
Home ] Up ] [ The Format Family ] The printf Family ]

 

MessageFormat
Explicit Formats
Summary of Patterns
Formatting Numbers

 

For some time, Java has provided the ability to format messages.  It uses the following classes to achieve this functionality:

  • Format
    • MessageFormat
    • NumberFormat
      • DecimalFormat
      • ChoiceFormat
    • DateFormat

These classes are part of the java.text package, which is primarily used for Internationalization. The subject of Internationalization (commonly called "I18N") is a very complex one, and we won't be covering it in detail here. Instead, we'll just give some examples of how to do the equivalent of some printf operations (albeit in a more convoluted fashion).

 

The page was last updated February 19, 2008