当前位置: 首页 > news >正文

建筑网站建设案例长春网站制作企业

建筑网站建设案例,长春网站制作企业,有没有学做蛋糕的网站和视频,微信怎么自己创建公众号一、collections概述 Collections和Arrays、Objects-一样,都是一种针对性的工具类, Arrays是针对数组,Objects是针对Object, 而Colections则是针对集合的一种工具类,里面提供了大量的方便我们操作集合的方法: //往集合中添加一些元素。 p…

一、collections概述

Collections和Arrays、Objects-一样,都是一种针对性的工具类,

Arrays是针对数组,Objects是针对Object,

而Colections则是针对集合的一种工具类,里面提供了大量的方便我们操作集合的方法:

//往集合中添加一些元素。
public static <T> boolean addAll(Collection<T> C, T... elements):
//打乱集合顺序。
public static void shuffle(List<?> list) :
//将集合中元素按照默认规则排序。
public static <T> void sort(List<T> list): 
//将集合中元素按照指定规则排序。
public static <T> void sort(List<T> list, Comparator<? super T>) :
//查找集合中另外-一个集合的位置。
public static int indexOfSubList(List<?> source,List<?> target): 
// 查找在集合中出现某个元素的次数。
public static int frequency(Collection<?> c,Object o):

二、演示

来进行Collections工具类的常用方法的演示

  • 转化成不可变集合的类别;
  • 同步安全类;
  • 查找和替换类;
  • 4排序类;
public class CollectionsDemo {public static void main(String[] args) {ArrayList<String> list = new ArrayList<String>();//addAllCollections.addAll(list, "Lucy","Kitty","Bob","Tom");System.out.println(list);//sortCollections.sort(list);System.out.println(list);//binarySearch//如果你要查找的元素不存在的话,那么返回的值不一定的负一System.out.println(Collections.binarySearch(list, "Kitty"));ArrayList<String> list1 = new ArrayList<String>();Collections.addAll(list1, "Lucy","Kitty","Kabi","Jery");//disjoint:如果不存在相同的,返回true,否则返回falseSystem.out.println(Collections.disjoint(list, list1));//转换成不可变列表List<String> unModifyList = Collections.unmodifiableList(list1);System.out.println(unModifyList);//不可变列表不能在进行操作
//		unModifyList.add("aaa");//fillCollections.fill(list1, "xxx");System.out.println(list1);//frequencySystem.out.println(Collections.frequency(list1, "xxx"));//shuffleCollections.shuffle(list);System.out.println(list);//indexOfSubListSystem.out.println(Collections.indexOfSubList(list, Collections.singletonList("Tom")));}
}
http://www.mmbaike.com/news/100255.html

相关文章:

  • 网页界面设计中交互设计是指夜狼seo
  • 网站建设的具体方法百度登录页面
  • 北京 科技网站建设东莞网站建设推广技巧
  • wordpress删除管理站点链接甘肃seo技术
  • 东乡做网站百度关键词竞价价格查询
  • 专门做海外服装购的网站有哪些自媒体平台排名
  • 怎么做示爱的网站数字营销策略有哪些
  • 网站推广的基本方法是什么2023年最新新闻简短摘抄
  • 1免费网站建站株洲网络推广
  • 电商网站及企业微信订烟长沙seo外包优化
  • 企业网站定制收费标准怎么学互联网怎么赚钱
  • 网站 自适应js北京seo优化wyhseo
  • 谷德设计网站官网入口西安关键词优化软件
  • 手机网站改版公司加盟网络优化的内容包括哪些
  • 网站定制开发与模版郑州网络营销公司哪个好
  • 茂名网站开发服务商超级优化大师
  • 涂料做哪个网站好宣传产品的方式
  • 凡科网站建设怎么去掉极速建站自己做网站需要多少钱
  • 青岛网站建设加盟公司品牌整合推广
  • 网站建设进度表 下载seo排名软件哪个好用
  • 今天战争最新消息新闻seo优化工作怎么样
  • 如何写网站建设方案站内推广和站外推广的区别
  • dsp投放方式搜索引擎技术优化
  • 网站建设的发展历史与新方向兰州seo优化公司
  • 绍兴网站制作公司镇江百度关键词优化
  • 大自然的网站设计查看今日头条
  • 和恶魔做交易的网站百度学术论文查重免费
  • 猪八戒做网站靠谱吗百度一下百度网站
  • 网站栏目设置说明鞍山seo优化
  • 云南网站建设公司关键词搜索排名软件