System.out.printf()
Formatted output.
Syntax
System.out.printf("format", ...)Description
With placeholders: %d number, %s text, %f decimal. Use %n or \n for a new line.
Example
Loading editor…
Expected output
Alex 36 years old
When to use?
Formatted tables, reports.