0

enter image description hereI was referring to the Collection Interface of Java 8, where I saw that Collection method has concrete method public boolean removeIf(Predicate paramPredicate) , but as per the definition of Interface we can only have static and default method with body and rest can be abstract. I tried creating the concrete method in an Interface and received compile time error Abstract methods do not specify a body with 3 quick fixes from eclipse:

  1. Change method to default
  2. Change method to static
  3. Remove method body

Can anyone explain how Collection interface has concrete implementation of methods removeIf , spliterator , stream , parallelStream ?

Prakash Vk
  • 21
  • 5

0 Answers0