Equals is a trait, which is a linking that accommodates functionalities of equality. It extends the class Any. The Linear Supertype here is Any and the Subclasses here are Product, Product1, Product2, and many more.
Abstract value members
The abstract value member here is:
abstract def canEqual(that: Any): Boolean
It returns true if the stated instances are equal.
Here, we have used canEqual method for proving the equality of the instances.
true false false
Here, we have used method equals and == for checking the equality.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.