Forum Stats

  • 3,873,348 Users
  • 2,266,538 Discussions
  • 7,911,514 Comments

Discussions

retainAll in Collection

User_G9420
User_G9420 Member Posts: 1 Green Ribbon
edited Aug 5, 2022 4:18PM in Java Programming

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?

Tagged:

Answers