作者:Apple_Web来源:blog.csdn.net/belongtocode/article/details/100635246平时工作中大家经常使用到boolean以及Boolean类型的数据,前者是基本数据类型,后者是包装类,至于新来的技术总监为什么这么反感这种方式?为什么不推荐使用isXXX来命名呢?到底是用基本类型的数据好呢,还是用包装类好呢?下面我们结合阿里手册一一道来吧!例子//1.其他非boolean类型private String isHot;public String getIsHot() { return isHot;}//2.boolean类型private boolean isHot;public boolean isHot() { return isHot;}//3.包装类型private Boolean isHot;public Boolean getHot() { return isHot;}//4.不以is开头private boolean hot;public boolean isHot() { return hot;}//5.包装类型private Boolean hot;public Boolean getHot() { return hot;}其实阿里巴巴发布的java开发手册中就写明了,强制规定,布尔类型的数据,无论是boolean还是Boolean都不准
………………………………