...

/

Operators: Equality, Inequality, and Comparison

Operators: Equality, Inequality, and Comparison

Explore structural and referential equality and understand the use of comparison operators.

We'll cover the following...

The equality and inequality operators

In Kotlin, there are two types of equality:

  • Structural equality: It is checked with the equals method or the == operator (and its negated counterpart !=).

    • The statemenet a == b translates to a.equals(b) when a is not nullable. Otherwise, ...