1.

What Is The Relationship Between Equals Method And == In Scala? Differentiate Scala’s == And Java’s == Operator?

Answer»

compare two instances with ==, Scala calls that object’s EQUALS() METHOD automatically.

Java’s == operator is USED to check References EQUALITY that is whether two references are pointing to the same object or not. Scala’s == is used to check Instances Equality that is whether two instances are equal or not.

compare two instances with ==, Scala calls that object’s equals() method automatically.

Java’s == operator is used to check References Equality that is whether two references are pointing to the same object or not. Scala’s == is used to check Instances Equality that is whether two instances are equal or not.



Discussion

No Comment Found