Java Boolean Logical Operators Question 3

Question

What is the output of the following code?

public class Main {
  public static void main(String[] args) {
    double x = 2;
    double y = 3;
    double z = 6;

    System.out.println("(x < y && y < z) is " + (x < y && y < z));
    System.out.println("(x < y || y < z) is " + (x < y || y < z));
    System.out.println("!(x < y) is " + !(x < y));
    System.out.println("(x + y < z) is " + (x + y < z));
    System.out.println("(x + y > z) is " + (x + y > z));
  }/*from   ww  w .ja v a  2s .  c o m*/
}


(x < y && y < z) is true
(x < y || y < z) is true
!(x < y) is false
(x + y < z) is true
(x + y > z) is false



PreviousNext

Related