SetÀÇ »ý¼º
TestTreeSet.java
import java.util.*;
public class TestTreeSet {
public static void main(String args[]) {
TreeSet ts = new TreeSet();
ts.add(new Integer(4));
ts.add(new Integer(2));
ts.add(new Integer(1));
ts.add(new Integer(3));
System.out.println("The capacity of ts is " + ts.size());
System.out.println("ts contains " + ts);
}
}
D:\java\util>javac TestTreeSet.java
D:\java\util>java TestTreeSet
The capacity of ts is 4
ts contains [1, 2, 3, 4]
Set ÀÎÅÍÆäÀ̽º¸¦ ±¸ÇöÇÑ Å¬·¡½ºµé¿¡¼ °´Ã¼¸¦ »ý¼ºÇÕ´Ï´Ù.
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ±è¿Ï±â |