10.10.2 static Interface Methods

Prior to Java SE 8, it was common to associate with an interface a class containing static helper methods for working with objects that implemented the interface. In Chapter 16, you’ll learn about class Collections which contains many static helper methods for working with objects that implement interfaces Collection, List, Set and more. For example, Collections method sort can sort objects of any class that implements interface List. With static interface methods, such helper methods can now be declared directly in interfaces rather than in separate classes.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.