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
cars = new LinkedList
(); cars.add("Volvo"); cars.add("BMW"); cars.add("Ford"); cars.add("Mazda"); cars.add("Toyota"); LinkedList
remove = new LinkedList
(); remove.add("Volvo"); remove.add("Ford"); remove.add("Mazda"); cars.removeAll(remove); System.out.println(cars); } }
[BMW, Toyota]