1
JavaIntermediate#strings
String.format uses a format string with placeholders for cleaner, locale-aware formatting of numbers, dates, and padding. Concatenation with + is simpler but creates intermediate objects and lacks formatting control.
String s = String.format("%s is %d years old", "Bob", 30);
// "Bob is 30 years old"