import java.util.*; public class Task1 { public static void main(String[] args) { ArrayList workers = new ArrayList<>(6); workers.add("Maximilian Mayer"); workers.add("Emil Faber"); workers.add("Anna Müller"); workers.add("Sebastian Waller"); workers.add("Oliver Stilz"); workers.add("Peter Huber"); print(workers); System.out.println(); System.out.print("Der erste Name: "); System.out.println(workers.get(0)); System.out.print("Der letzte Name: "); System.out.println(workers.get(workers.size() - 1)); workers.set(3, "Frank Starke"); System.out.println(); print(workers); } public static void print(ArrayList list) { System.out.println(list.get(0)); System.out.println(list.get(1)); System.out.println(list.get(2)); System.out.println(list.get(3)); System.out.println(list.get(4)); System.out.println(list.get(5)); } }