实例 Java 使用 "等于" 运算符计算布尔表达式

x
 
public class Main {
  public static void main(String[] args) {
    int x = 10;
    System.out.println(x == 10); // returns true, because the value of x is equal to 10
  }
}
                    

输出结果

true