实例 Java 比较运算符 !=

x
 
public class Main {
  public static void main(String[] args) {
    int x = 5;
    int y = 3;
    System.out.println(x != y); // returns true because 5 is not equal to 3
  }
}
                    

输出结果

true