June 10, 2016

Default Method in Java 8

Introduction

Default Method in Java 8 is used for adding new methods in Interface without needing to altering implementing Classes.

Example: Original version

Now we want to add new methods to interface, but if we did we also need to update implementing Classes. Instead of doing that we could use the new Default Method feature in Java 8

No comments: