Java Relational Operators Question 2

Question

What is the output of the following code?

public class Main {

  public static void main(String[] Strings) {
    int x = 1;/*w w w .  j  a  va  2s .  c  o m*/
    System.out.println(x > 0);
    System.out.println(x < 0);
    System.out.println(x != 0);
    System.out.println(x >= 0);
    System.out.println(x != 1);
  }
}


true
false
true
true
false



PreviousNext

Related