public class Printf01 { public static void main(String[] args) { System.out.printf("%f,%b",Math.PI,Math.E); //输出:3.141593,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
62,621
社区成员
307,251
社区内容
加载中
试试用AI创作助手写篇文章吧