import java.util.HashSet; class Ch15_Demo5{ public static void main(String[] args) { HashSet users=new HashSet(); users.add(new User("张三",28)); users.add(new User("李四",25)); users.add(new User("王 五",31)); System.out.println(users.size()); users. remove(new User("张 三",28)); System.out.println(users.size()); } } 结果:3 3
我明明都删了一个怎么还是3啊!
|