1、在你的项目中需要引入hutool的jar包
2、创建一个boolean类型的值
3、Integer integer = BooleanUtil.toInteger(b);//boolean值转为Integer
4、运行程序查看得到的结果
5、如果布尔值为false则结果为0