Equality and Identity
Explore Kotlin's approach to equality and identity, learning to use the == operator for safe structural equality checks and === for reference identity. Understand the differences from Java and how Kotlin's design enhances code safety and readability.
Equality
Kotlin internally converts == to the call of equals.
This means, that in Kotlin, we check instances with == for structural equality instead of identity, like in Java.
As a consequence, we ...