❮ LinkedList Methods
LinkedListDefinition and Usage
The forEach() method performs an action on every item in a list. The action can be defined by a lambda expression that is compatible with the accept() method of Java's Consumer interface.
To learn about lambda expressions, see our Java Lambda Expression tutorial .
Syntax
public void forEach(Consumer
action )Parameter Values
| Parameter | Description |
|---|---|
| action | Required. A Consumer object or lambda expression which performs an action on an item. |