布尔文字仅表示两个值true或false。在Java中,将值1假定为true,将值0假定为false。
public class Test{
public static void main(String args[]) throws Exception{
boolean bool1 = true;
boolean bool2 = false;
boolean bool = (25==(100/4));
System.out.println(bool1);
System.out.println(bool2);
System.out.println(bool);
}
}输出结果
true false true