public static void main(String[] args) { SimpleHashMap2<String, String> m = new SimpleHashMap2<String, String>(); m.putAll(Countries.capitals(15)); System.out.println(m); System.out.println(m.get("BULGARIA")); System.out.println(m.entrySet()); m.entrySet().remove(m.entrySet().iterator().next()); System.out.println(m); m.entrySet().remove(m.entrySet().iterator().next()); System.out.println(m); m.entrySet().removeAll(m.entrySet()); System.out.println(m); }
public static void main(String[] args) { // TODO 自动生成的方法存根 List<String> countrynames = new ArrayList<String>(Countries.names(10)); System.out.println(countrynames); Collections.sort(countrynames); System.out.println(countrynames); for (int i = 0; i < 5; i++) { Collections.shuffle(countrynames); System.out.println(countrynames); } }