Kotlinlearncs.online LogoJava
Return to List

Homework: Object v. Reference Equality

Created By: Geoffrey Challen
/ Version: 2020.10.0

Implement a public class method named compare on a public class Comparison that accepts two Object arguments. It should return 0 if both references are equal, 1 if both objects are equal, and -1 otherwise. Either reference can be null, so you'll need to handle those cases carefully!

Related Lessons

Stuck? You may find these lessons helpful: