Logical Operators
Combine boolean expressions with &&, ||, !.
package DSA.Operators;
public class logical { @SuppressWarnings("unused") public static void main(String[] args) { System.out.println((3 > 1) && (5 > 0));// true System.out.println((3 > 1) && (5 < 0));// false System.out.println((3 > 1) || (5 > 0));// true System.out.println((3 > 1) || (5 < 0));// true System.out.println((3 < 1) || (5 < 0));// false System.out.println(!((3 > 1) && (5 < 0)));// true }}