bod
11/29/2018, 12:44 PMequals
work for sealed classes?diesieben07
11/29/2018, 12:47 PMbod
11/29/2018, 12:54 PMdiesieben07
11/29/2018, 12:56 PMequals
is a call to a polymorphic function. The exact function to call (equals
in Any
or equals
in your data class, etc.) is determined at runtime based on the actual type of the object.bod
11/29/2018, 12:59 PMequals
of the “sub type” is used. Makes sense. What if I override the equals
of the sealed class however?diesieben07
11/29/2018, 1:00 PMA extends B extends C
and only B
has equals
then objects of type C
will use that equals.bod
11/29/2018, 1:02 PM