Skip to Main Content

Java Programming

retainAll in Collection

User_G9420Aug 5 2022 — edited Aug 5 2022

The interface Collection specifies retainAll as an optional method. But if an implementing class does not define it, you get the error "does not override abstract method retainAll(Collection<?>) in Collection." How can you omit an optional method without getting an error message?

Post Details
Added on Aug 5 2022
1 comment