import java.util.HashSet;출력:
import java.util.TreeSet;
import java.util.Set;
public class HashSettoTreeSet{
public static void main(String[] args) {
HashSethashset = new HashSet ();
hashset.add("E1");
hashset.add("E2");
hashset.add("E3");
hashset.add("E4");
hashset.add("E5");
System.out.println("해시셋: "+ 해시셋);
// HashSet
Settreeset = new TreeSet (hashset);
System.out.println("트리셋: ");
for(문자열 e : 트리셋){
System.out.println(e);
}
}
}
HashSet: [E1, E2, E3, E4, E5]
TreeSet: [E1, E2, E3, E4, E5]
Please disable your ad blocker and refresh the window to use this website.