Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

Practice this question and more.


Which of these is NOT a relational operator in Java?

  1. <=

  2. ==

  3. =>

  4. !=

The correct answer is: =>

Relational operators are used to compare two values in Java. The <= (less than or equal to) operator checks if the left value is less than or equal to the right value. The == (equal to) operator checks if the two values are equal. The != (not equal to) operator checks if the two values are not equal to each other. These operators are all part of the relational operators in Java. On the other hand, the => (greater than or equal to) operator is not a relational operator in Java. It is commonly used as part of the function syntax in lambda expressions, not for comparing values. Therefore, the correct answer is C =>.