-
JAVA Collections常用方法
-
- 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);
- }
- }
-
相关阅读:
谷歌脸书第三方登录
初步了解Owin
select2去掉搜索框
angularjs教程——自定义指令
angularjs教程——Dom操作相关指令详解
http://172.21.87.57:8081/seeyon/
nce 1,a puma at large
股池
永清环保
出门需要带的东西
-
原文地址:https://www.cnblogs.com/dongrilaoxiao/p/6677889.html
Copyright © 2020-2023
润新知