Credit: Y. Daniel Liang, Introduction to Java Programming (Comprehensive Version), 10th ed.
But a lot of the time, it’s not as simple as just using relational operators. Sometimes a condition is dependent on other conditions. For instance, if I am registered to vote and I am 18 or older, I can vote. That’s where logical operators come in.