把test.java救回来了
This commit is contained in:
+20
-20
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user