Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeLanguages
Java
jls21
Equality Operators

Java Language Specification, Version Java SE 21 Edition
15.21. Equality Operators

Read this Section of the Authoritative Specification

https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.21

3 Documented Misconceptions

Misconception
AssignCompares
= compares two values
Misconception
EqualityOperatorComparesObjectsValues
o==p compares the objects referred to by variables o and p
Misconception
EqualsComparesReferences
o.equals(p) compares the references stored in the variables o and p

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors