package bull.SetandHastSet;
import java.util.HashSet;
public class SetDemo1 {
public static void main(String[] args) {
HashSet<String> hs = new HashSet<String>();
hs.add("hello");
hs.add("world");
hs.add("java");
System.out.println(hs.add("java"));
for(String s : hs) {
System.out.println(s);
}
}
}
package bull.SetandHastSet;
import java.util.HashSet;
public class SetDemo2 {
public static void main(String[] args) {
HashSet<Student> hs = new HashSet<Student>();
Student stu1 = new Student("张三",10);
Student stu2 =