-
- import java.util.*;
-
- class Test
- {
-
- public static void main(String [] args)
- {
- List<String> ls = new ArrayList<String>();
-
- ls.add("aaa");
- ls.add("afs");
- ls.add("fds");
- ls.add("bcd");
-
- sop(ls);
-
- Collections.sort(ls);
-
- sop(ls);
-
- String tmp = Collections.max(ls);
- sop("max :"+tmp);
-
- int index = Collections.binarySearch(ls,"bcd");
- sop("index :" + index);
- int index2 = Collections.binarySearch(ls,"bcde");
- sop("index2 :" + index2);
-
-
-
- Collections.replaceAll(ls, "afs","KK");
- sop(ls);
-
-
- Collections.reverse(ls);
- sop(ls);
-
-
-
- Collections.fill(ls,"pp");
- sop(ls);
- }
-
- public static void sop(Object obj)
- {
- System.out.println(obj);
- }
- }