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"); LinkedList
brands = new LinkedList
(); brands.add("Microsoft"); brands.add("W3Schools"); brands.add("Apple"); brands.addAll(cars); System.out.println(brands); } }
[Microsoft, W3Schools, Apple, Volvo, BMW, Ford, Mazda]