Skip to content

Glossary: Java Beyond the Basics

Format specifiers

Also written: formatted, %-7s, %,.2f, %d

Codes inside text passed to formatted() that insert values: %d for a whole number, %.2f for a decimal with 2 places, %s for text, with widths like %-7s to pad columns and a comma to group thousands.

Where the book teaches it

Related terms

Text block