Run ❯
Get your
own Java
server
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
import java.util.LinkedList; public class Main { public static void main(String[] args) { LinkedList
numbers = new LinkedList
(); numbers.add(5); numbers.add(9); numbers.add(8); numbers.add(6); numbers.add(1); numbers.removeIf( n -> n % 2 == 0 ); System.out.println(numbers); } }
[5, 9, 1]