CHAPTER REVIEW

5.13 Chapter Summary

  • Java provides equality, relational, and logical operators to evaluate a condition, and selection statements to choose which instructions to execute based on whether a condition evaluates to true or false.

  • The equality operators (==, !=) are used to test whether two operands are equal. The operands are expressions that evaluate to a primitive numeric or boolean type or an object reference.

  • The relational operators (<, <=, >, >=) compare the values of two operands that are expressions that evaluate to a primitive numeric type.

  • The logical operators (!, &&, and ||) take boolean expressions as operands. The logical NOT (!) takes one operand, and inverts its value, changing true to false and false to true ...

Get Java Illuminated, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.