Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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?

Comments
Post Details
Added on Aug 5 2022
1 comment
336 views