Java officially supported lambda expressions since Java 8 was released in 2014. Lambda expressions are shorthand implementations for Single Abstract Method (SAM) classes. In other words, they are quick ways to pass functional arguments instead of anonymous classes.
Introducing lambda expressions
Implementing Runnable using lambda expression
Prior to Java 8, you might have leveraged anonymous classes to implement interfaces, such as Runnable, on the fly, as shown in the following code snippet:
public class A_01 {
public static void main(String[] args) {
Runnable runnable = new Runnable() {
@Override
public void run() {
System.out.println("run() was called!");
...