// printf formats the text by placing the placeholders into the first string
// placeholders are noted first with '%s' and then you list them in their order
System.out.printf( "Test ( %s ): %s", 3.75, "ok" );
// will give:
Test ( 3.75 ): ok
// comlete placeholders you use for known variables:
// %f : float and double
// %d : int and long
// %c : char
// %b : boolean
float f = 15.47f;
long l = 765432L;
char c = '@';
boolean b = true;
System.out.printf( "Test2 ( %f ): %d -> %c%b", f, l, c, b );
// will give:
Test2 ( 15,470000 ): 765432 -> @true
// number of decimals:
// %.4f : 4 decimals after the dot
System.out.printf( "Test3 ( %.4f ): %d -> %c%b", f, l, c, b );
// will give:
Test3 ( 15,4700 ): 765432 -> @true