O'Reilly logo

Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams by Jamie Jaworski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comparison Operators

The comparison operators are used to compare primitive values or object references. They are organized into three subgroups: the relational operators, the equality operators, and the instanceof operator. The relational operators are only defined for numeric values, and the instanceof operator is only defined for object references.

The Relational Operators

The four relational operators are < (less than), <= (less than or equal to), > (greater than), and >= (greater than or equal to). These operators follow their mathematical definitions and produce a boolean value as their result. However, you should note that any relational expression with the NaN value evaluates to false.

The Equality Operators

The equality operators consist ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required