Why use interface type to declare a collectio - glf2046 - 博客园
.collect(Collectors.toSet()); System.out.println(distinctWords.size()+ " distinct words: " + distinctWords); } } Using the for-each Construct: import java.util.*; public class FindDups { public static void main(