Skip to content

Commit fdd562f

Browse files
Add files via upload
1 parent dc7d52b commit fdd562f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

HashSetDemo3.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.util.HashSet;
2+
3+
public class HashSetDemo3 {
4+
public static void main(String[] args) {
5+
HashSet<String> set = new HashSet<>();
6+
HashSet<String> cloned_set = new HashSet<>();
7+
set.add("A");
8+
set.add("a");
9+
set.add("B");
10+
set.add("b");
11+
System.out.println(set);
12+
13+
cloned_set = (HashSet)set.clone();
14+
System.out.println(cloned_set);
15+
16+
}
17+
18+
}

0 commit comments

Comments
 (0)