Hi,
the Vaildation says that I would enter the numbers via keyboard and that the method "setErstellen()" would not give a HashSet with 20 integer elements. Does anyone know where my mistake is? Thank You
package de.codegym.task.task08.task0814;
import java.util.HashSet;
import java.util.Set;
/*
Größer als 10? Du passt nicht gut zu uns
*/
public class Solution {
public static HashSet<Integer> setErstellen() {
// schreib hier deinen Code
HashSet<Integer> hashset = new HashSet<>();
for (int i = 0; i < 20; i++) {
hashset.add(i);
}
return hashset;
}
public static HashSet<Integer> alleZahlenGroesserAls10Entfernen(HashSet<Integer> set) {
// schreib hier deinen Code
set.removeIf(n -> n > 10);
return set;
}
public static void main(String[] args) {
}
}