1、Set视图和Set的区别
Set视图可以重复,Set不可以重复
IdentityHashMap im=new IdentityHashMap();
//im.put(new String("445-0691507"),"B0");
im.put(new String("445-0691508"),"A0");
im.put(new String("445-0691507"),null);
im.put(new String("445-0691509"),"C0");
im.put(new String("445-06915010"),"D0");
im.put(new String("445-0691507"),null);
im.put(new String("445-0691507"),null);
Set<String> allKey=im.keySet();
for(String s:allKey)
{
System.out.println(s);
}
结果:
445-0691509
445-0691507
445-0691508
445-06915010
445-0691507
445-0691507