Java Logical And Operator Example


Program
public class LogicalAndOperatorExample{ public static void main(String args[]){ int x=15; int y=25; int z=35; System.out.println(x<y&&x<z); //true && true =true System.out.println(x<y&&x>z); //true && false =false System.out.println(x>y&&x<z); //false && true =false System.out.println(x>y&&x>z); //false && false =false }}
Input
Output