Relational Operators


  • Relational operators always result in a boolean value (true or false).
  • There are six relational operators: >, >=, <, <=, ==, and !=. The last two (== and !=) are sometimes referred to as equality operators.
  • When comparing characters, Java uses the Unicode value of the character as the numerical value.
  • Equality operators
  • There are two equality operators: == and !=.
  • Four types of things can be tested: numbers, characters, booleans, and reference variables.
  • When comparing reference variables, == returns true only if both references refer to the same object.