提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
布尔算术表达式
public class Main { public static void main(String[] args) { /** nowjava.com 提供 **/ boolean b1 = (6 - 2) == 4; boolean b2 = 22 / 7 == 3 + 1 / 7.0; boolean b3 = 22 / 7 == 3 + 1 / 7; System.out.println(b1); // true System.out.println(b2); // false System.out.println(b3); // true } }