import java.util.*; public class Task3 { public static void main(String[] args) { var javaList = new HashSet(3); var pythonList = new HashSet(3); var commonList = new HashSet(); var differenceSet = new HashSet(); javaList.add("Maximilian Mayer"); javaList.add("Emil Faber"); javaList.add("Anna Müller"); pythonList.add("Anna Müller"); pythonList.add("Sebastian Waller"); pythonList.add("Oliver Stilz"); commonList.addAll(javaList); commonList.addAll(pythonList); differenceSet.addAll(javaList); differenceSet.retainAll(pythonList); System.out.println("Java-Kurs: " + javaList); System.out.println("Python-Kurs: " + pythonList); System.out.println("Alle Teilnehmer: " + commonList); System.out.println("Beide Kurse: " + differenceSet); } }