var fontSize = 14;
var fontFamily = "Arial";
//Java 13 Feature
var style1 = "font-size: %d; font-family: %s"
.formatted(fontSize, fontFamily);
//style1 is "font-size: 14; font-family: Arial"
var style2 = String.format(
"font-size: %d; font-family: %s",
fontSize, fontFamily);
//style2 is "font-size: 14; font-family: Arial"
System.out.printf("style1 is '%s'\n", style1);
System.out.printf("style2 is '%s'", style2);