Java中的布尔文字是什么?
布尔文字仅表示 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
广告
数据结构
网络技术
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP