PRACTICE / UNDERSTAND / REPEAT

Java practice question

Practice types & equality with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

1 questionAnswers explainedFree · no login

Try this question

Types & equality · MCQQuestion link ↗

What does `==` compare for two Java object references?

Choose one answer
Answer & explanation

Answer: Whether both references point to the same object

For objects, `==` compares reference identity. Use an appropriate `equals` implementation for value equality.