default method

A collection of 1 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Sep 2, 2018 api design interface default method java 8

Default methods in Java 8, and what it changes in API design

Java 8 introduced default methods in interfaces. This post describes what they are, and how they can change the design of APIs. A nominal design Earlier, in Java, interfaces could only have contracts - method signatures with no implementation. In order to add some implementation, a class was required, whether abstract or not. Hence, traditional API design then followed this hierarchy: The root interface defines the contractAn intermediate class implements common behavior i.e. BarIf

Nicolas Fränkel
A Java geek © 2008-2026
v. f9f9ef23b7bec5c4c1c077d233f54dc945bd0364/12635848204
Latest Posts