My code seems to work properly (tested with System.out.println ) but for some reason, I got the error:
The program should not read values from the keyboard.
Would you please check if there is an error that I can't see?
Thanks a lot!
package com.codegym.task.task08.task0814;
import java.util.HashSet;
import java.util.Set;
/*
Greater than 10? You're not a good fit for us
*/
public class Solution {
public static Set<Integer> createSet() {
// write your code here
HashSet<Integer> set = new HashSet<>();
for (int i = 0; i <20 ; i++) {
set.add(i);
}
return set;
}
public static HashSet<Integer> removeAllNumbersGreaterThan10(HashSet<Integer> set) {
// write your code here
set.removeIf(n -> (n > 10));
return set;
}
public static void main(String[] args) {
}
}