public class StringExample { public static void main(String [] args) { float floatVar = 5.333F; // if you miss the F at the end you get an error about possible loss of precision. int intVar = 100; String stringVar = "Python"; String fs = String.format("The value of the float variable is " + "%f, while the value of the integer " + "variable is %d, and the string " + "is \"%s\"", floatVar, intVar, stringVar); System.out.println(fs); } }