Java Snippet
Format Strings with String.format
Difficulty: Easy
`String.format` is Java's printf-style formatter for building human-readable strings without ad-hoc concatenation. This snippet covers the common conversions (`%s`, `%d`, `%.2f`, `%n`), padding and alignment for table layouts, and locale-aware vs locale-independent formatting. Reach for `String.format` for any output that mixes types or needs precise width control.
