public static void main(String[] args) { //Initialisieren wie ArrayLists var colors = new HashSet(); // use add() method to add values in the hash set colors.add("Red"); colors.add("Green"); colors.add("Black"); colors.add("White"); colors.add("Pink"); colors.add("Yellow"); var newcolors = new HashSet(); newcolors.add("Red"); newcolors.add("Pink"); newcolors.add("Black"); newcolors.add("Orange"); //comparison output in hash set HashSetresult_set = new HashSet(); for (String element : colors){ System.out.println(newcolors.contains(element) ? "Yes" : "No"); } } }