StringFormat for Java Boolean Operator

Solution 1:

'b' or 'B' general If the argument arg is null, then the result is "false". If arg is a boolean or Boolean, then the result is the string returned by String.valueOf(arg). Otherwise, the result is "true". java docs : http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax

enter image description here

Solution 2:

System.out.printf("boolean variable is %b",boolVar);