Mastering Java 2026 – 400 Free Practice Questions to Pass the 'Thinking in Java' Exam

Question: 1 / 510

What operator is used in Java to show equality between two variables?

=

==

In Java, the == operator is used to check for equality between two variables. This means that it will return true if the two variables store the same value, and false if they do not. Option A, the = operator, is used to assign a value to a variable. Option C, the === operator, is not a valid operator in Java and should not be used. Option D, the != operator, checks for inequality between two variables, meaning it will return true if the variables store different values and false if they store the same value. Therefore, it is also not the correct operator to use in this scenario.

Get further explanation with Examzify DeepDiveBeta

===

!=

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy