把test.java救回来了

This commit is contained in:
2024-06-11 01:53:01 +08:00
parent d085000064
commit d753356d40
54 changed files with 1309 additions and 1297 deletions
+20 -20
View File
@@ -1,21 +1,21 @@
package task3;
import java.util.HashSet;
import java.util.Scanner;
public class HelloSet {
public static void main(String[] args) {
HashSet<Object> hashSet = new HashSet<>();
Scanner scanner = new Scanner(System.in);
for (int i = 0; i < 5; i++) {
hashSet.add(scanner.next());
}
// ---------------------Begin------------------------
hashSet.add("helloHashSet");
hashSet.remove("cat");
hashSet.add("fish");
hashSet.remove("apple");
// ---------------------End------------------------
hashSet.forEach(ele -> System.out.println(ele));
}
package task3;
import java.util.HashSet;
import java.util.Scanner;
public class HelloSet {
public static void main(String[] args) {
HashSet<Object> hashSet = new HashSet<>();
Scanner scanner = new Scanner(System.in);
for (int i = 0; i < 5; i++) {
hashSet.add(scanner.next());
}
// ---------------------Begin------------------------
hashSet.add("helloHashSet");
hashSet.remove("cat");
hashSet.add("fish");
hashSet.remove("apple");
// ---------------------End------------------------
hashSet.forEach(ele -> System.out.println(ele));
}
}