java去掉数组中重复的元素
public static void main(String[] args) { String[] stringtmp = { "1", "2", "3", "2" }; Map<String, String> map = new HashMap<String, String>(); for (int i = 0; i < stringtmp.length; i++) { map.put(stringtmp[i], stringtmp[i]); } System.out.println(map.size()); }
?