package Set;
import java.util.Collections;
import java.util.HashSet;
public class HashSetDemo01 {
public static void main(String[] args) {
HashSet<dog> hashSet = new HashSet<>();
Collections.addAll(hashSet,new dog("乖乖",1),new dog("招财",3),new dog("招财",3));
System.out.println(hashSet);


}
}
|