课程: Java Essential Training: Syntax and Structure

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Relational operators

Relational operators

- [Angie] Relational operators are symbols used within conditions. Let's look at examples of Java's six relational operators within boolean expressions. The greater than operator evaluates if the number on the left of the symbol is greater than the number on the right. In this example, our expression asks, is two greater than three? And this results to false. The less than operator evaluates if the number on the left is less than the number on the right. Is two less than three? Yes it is. So this results to true. The greater than or equal operator evaluates if the number on the left is either greater than or equal to the number on the right. Four is greater than or equal to four, so this results to true. The less than or equal operator evaluates if the number on the left is either less than or equal to the number on the right. Four is not less than or equal to three, so this results to false. The equal…

内容