实现了实验三的添加和移除

This commit is contained in:
2024-06-11 00:01:09 +08:00
parent 3ed537d041
commit 9b0e1d1d0f
+2
View File
@@ -11,6 +11,8 @@ public class HelloSet {
hashSet.add(scanner.next()); hashSet.add(scanner.next());
} }
// ---------------------Begin------------------------ // ---------------------Begin------------------------
hashSet.add("helloHashSet");
hashSet.remove("apple");
// ---------------------End------------------------ // ---------------------End------------------------
hashSet.forEach(ele -> System.out.println(ele)); hashSet.forEach(ele -> System.out.println(ele));
} }