Java Programming Tutorial - Logical Operators






public class Coffee{
public static void main(String arg[]) {
int boy, girl;
boy = 18;
girl = 40;
if(boy>10 && girl < 60) {
System.out.println("You can enter");
} else {
System.out.println("You can not enter");
}
}
}



public class Coffee{
public static void main(String arg[]) {
int boy, girl;
boy = 18;
girl = 40;
if(boy>10 ||  girl < 60) {
System.out.println("You can enter");
} else {
System.out.println("You can not enter");
}
}
}

Comments