~/ 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/e7932c93-b1e8-4e8f-8704-ad687296b92b/flashcard utf-8 LF