/*
关于布尔型数据类型:
boolean
在java语言中boolean类型只有两个值:true、false,没有其它值
不像c语言中,0和1可以表示假和真
在底层存储的时候boolean类型占用1个字节,因为实际存储的时候false底层是0,true底层是1
布尔类型在实际开发中是非常重要的,经常使用在逻辑运算和条件控制语句中
*/
public class DateTypeTest07
{public static void main(String[] args){//编译错误:不兼容的类型//boolean flag=1;boolean loginSuccess=true;//if语句if(loginSuccess){System.out.println("恭喜你,登录成功!"); }esle{System.out.println("对不起,用户名不存在或者密码错误");}}
}