~/ learn/ comp-308/ cards/ Annotations: built-ins and defining your own
1 of 8

Type the @Override on a correct equals signature

Type the @Override on a correct equals signature

Answer

class Point { @Override public boolean equals(Object o) { return o instanceof Point; } }

If the signature were equals(Point), it would NOT override Object.equals and @Override would force a compile error — catching the silent-overload bug.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/61155635-6595-4905-a14e-b83eff83d95a/flashcard utf-8 LF