Introduction
Java is a rich and versatile language that has evolved significantly over time. A noteworthy addition in Java 8 is the lambda expression, often associated with the arrow operator. It might seem complex at first, but it's not that difficult once you understand it.

So let's explore the arrow operator in Java and see how it simplifies code.
Understanding Lambda Expressions
Lambda expressions are a way of representing anonymous functions (functions without a name) that we can pass around like any other object. The 'arrow' or '->' is a fundamental part of this expression and represents the lambda operator.
Syntax of Lambda Expression
The lambda expression's syntax is
(argument-list) -> {body}.
The arrow operator separates the list of parameters from the body of the lambda expression.
How Lambda Expressions Work
To understand how lambda expressions work, let's consider an example. Imagine we have a list of names, and we want to print each one. Without lambda expressions, we'd do it like this:
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
class CodingNinjas {
public static void main(String[] args) {
List<String> names = Arrays.asList("John", "Jane", "Tom");
for(String name : names){
System.out.println(name);
}
}

With lambda expressions, we simplify this to:
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
class CodingNinjas {
public static void main(String[] args) {
List<String> names = Arrays.asList("John", "Jane", "Tom");
names.forEach(name -> System.out.println(name));
}
}
Output

The code name -> System.out.println(name) is a lambda expression. Here, 'name' is the parameter passed into the lambda, and the 'println' statement is the body executed for each name in the list.
Also see, Eclipse ide for Java Developers