Set<Integer> numbers = new LinkedHashSet<Integer>(Arrays.asList(1,2,3,4)); for(Integer i : numbers) { if( i % 2 == 0) numbers.remove(i); } System.out.println(numbers);
Login in to like
Login in to comment
or Read more about Java Quizzes
Login in to like
Login in to comment