Static method in interface in Java 8

In this tutorial let us learn about static method in interface in Java 8.Prior to Java 8, interfaces can only have public abstract methods. It was not possible to implement a method in the interface itself and It was also not possible to add new functionality to the existing interface without forcing all implementing classes to create an implementation of […]

Default method in interface in Java 8

In this tutorial let us learn about Default method in interface in Java 8. Java interfaces can now have default methods.Prior to Java 8, interfaces can only have public abstract methods. It was not possible to implement a method in the interface itself and It was also not possible to add new functionality to the existing interface without forcing all […]

Java 8 | forEach with examples

In this tutorial let us learn about Java 8 forEach with examples. The main use of forEach is to iterate over a collection. There are multiple ways to iterate a collection but in Java 8, the new forEach statement has made it look so simple and legible. Please refer How to use forEach for more information. Iterate a list – […]