L3.2: Logical Expressions: Logical operators - Or ||

PHOTO EMBED

Tue Oct 17 2023 07:59:43 GMT+0000 (Coordinated Universal Time)

Saved by @testpro #java

public class Main {
    public static void main(String[] args) {

        boolean hasAccessCard = true;
        boolean hasSecurityClearance = false;

        boolean canEnterRestrictedArea = hasAccessCard || hasSecurityClearance;

        System.out.println("Can the user enter the restricted area? " + canEnterRestrictedArea);
    }
}
// Output: Can the user enter the restricted area? true
content_copyCOPY