we can use printf() or format() method to format string in java
fs=System.out.format("float variable is " + "%f, integer variable is " + " %d, string variable is " + "is %s", floatVar, intVar, stringVar);
System.out.printf("float variable is " + "%f, integer variable is " + " %d, string variable is " + "is %s", floatVar, intVar, stringVar);