提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
查找哈希集中的最大元素
import java.util.HashSet;/** 来 自 N o w J a v a . c o m - 时代Java**/ import java.util.Collections; public class Main { public static void main(String[] args) { HashSet hashSet = new HashSet(); hashSet.add(new Long("9")); hashSet.add(new Long("4")); hashSet.add(new Long("2")); hashSet.add(new Long("2")); hashSet.add(new Long("3"));