O'Reilly logo
  • mangesh Hankare thinks this is interesting:

In Scala, the == method defined in the AnyRef class first checks for null values, and then calls the equals method on the first object (i.e., this) to see if the two objects are equal. As a result, you don’t have to check for null values when comparing strings.


Cover of Scala Cookbook


== and equals