Page 45 - Abstract Class, Interface & Struktur Data
P. 45
addLast
import java.util.LinkedList;
public class Main {
public static void main(String[] args) {
LinkedList<String> cars = new LinkedList<String>();
cars.add("Volvo");
cars.add("BMW");
cars.add("Ford");
// Use addLast() to add the item to the end
cars.addLast("Mazda");
System.out.println(cars);
}
}