Checking the “boolean” result of an “int” type

前端 未结 8 1524
死守一世寂寞
死守一世寂寞 2020-12-10 23:43

I\'m learning Java, coming from C and I found an interesting difference between languages with the boolean type. In C there is no bool/ean

8条回答
  •  Happy的楠姐
    2020-12-11 00:37

    Try BooleanUtils from Apache common-lang.

      BooleanUtils.toBoolean(0) = Boolean.FALSE
      BooleanUtils.toBoolean(1) = Boolean.TRUE
      BooleanUtils.toBoolean(2) = Boolean.TRUE
    

提交回复
热议问题