check how many placeholders are there in string in java 8 code example
Example: java string format with placeholder
String s = "hello %s!";
s = String.format(s, "world");
assertEquals(s, "hello world!"); // should be true
String s = "hello %s!";
s = String.format(s, "world");
assertEquals(s, "hello world!"); // should be true