Comparison Operators

Operators that compare two values and produce true or false.

What is Comparison Operators in Java?

Comparison Operators — Operators that compare two values and produce true or false.

class Venue {
    boolean canEnter(int age) {
        boolean isAdult = age >= 18;
        boolean isSenior = age >= 65;

        if (isAdult && !isSenior) {
            return true;
        }

        return false;
    }
}

Level: Novice · More Java terms at this level

Updated

In other subjects