News

In this Java 101 tutorial, I’ve explained how interfaces differ from classes, and showed you how to declare, implement, and extend interfaces in your Java programs.
This time, we’ll use the List interface and its method .forEach in combination with the Consumer functional interface. Suppose you have a list of Mascot objects.