Chapter 7. Formatting

Formatting

7.1 Strings and string handling

7.2 Tokenizers and envelopes

7.3 Inside the Stream class

7.4 Formatting numbers

7.5 Dates, calendars and time

In this chapter we consider the various ways that Java provides for formatting text, both internally and externally. Initially, Java did not have much in this regard, but Java 2 has extensive facilities for handling data in a manner that is locale-dependent. This means that programs can present themselves in the most appropriate style for the country in which they run. In many ways, such presentation details could be regarded as not essential in a first course, but we give them here to show ...

Get Java Gently, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.