printf的问题
public class Printf01
{
public static void main(String[] args) {
System.out.printf("%f,%b",Math.PI,Math.E); //输出:3.141593,true
}
}
请问:第二个参数是 %b,应该接受boolean值,为什么接受了 Math.E 能够编译,并且输出 true。
请大神帮忙! --------------------编程问答-------------------- 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".
source : Formatter javadoc --------------------编程问答-------------------- --------------------编程问答-------------------- --------------------编程问答--------------------
补充:Java , Java SE