Skip to content

Instantly share code, notes, and snippets.

@not-for-me
Created December 28, 2015 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save not-for-me/fce2871ba1f89123a19e to your computer and use it in GitHub Desktop.
Save not-for-me/fce2871ba1f89123a19e to your computer and use it in GitHub Desktop.
In Scala, '==' is equals with 'equals()'. Try to execute below code sniff on the repl.
case class Dummy(a: Int, b: Double)
val obj1 = Dummy(1, 10.0)
val obj2 = Dummy(2, 20.0)
val obj3 = Dummy(1, 10.0)
obj1 == obj2
obj1 equals obj2
obj1 == obj3
obj1 equals obj3
obj2 == obj3
obj2 equals obj3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment