StringFormat for Java Boolean Operator

前端 未结 6 487
再見小時候
再見小時候 2020-12-29 17:54

I know its very simple question. but I would like to know the stringformat for boolean operator. For example, below shows the string formats for integer, string and float.

6条回答
  •  -上瘾入骨i
    2020-12-29 18:35

    '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

提交回复
热议问题