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

qq空间可以做网站吗做推广的公司一般都叫什么

qq空间可以做网站吗,做推广的公司一般都叫什么,卢湾广州网站建设,原来做网站后来跑国外了写在开头#xff1a;本文用于作者学习Java常用API 我将官方文档中Collections类中所有API全测了一遍并打印了结果#xff0c;日拱一卒#xff0c;常看常新 addAll() 将所有指定元素添加到指定 collection 中 可以添加一个或多个元素 Testpublic void test_addAl…写在开头本文用于作者学习Java常用API 我将官方文档中Collections类中所有API全测了一遍并打印了结果日拱一卒常看常新 addAll() 将所有指定元素添加到指定 collection 中         可以添加一个或多个元素 Testpublic void test_addAll(){/*将所有指定元素添加到指定 collection 中* 可以添加一个或多个元素*/ArrayListString strings new ArrayList();strings.add(1);strings.add(2);strings.add(3);Collections.addAll(strings, a,b,c);System.out.println(strings);//[1, 2, 3, a, b, c]System.out.println(Collections.addAll(strings, d));System.out.println(strings);//[1, 2, 3, a, b, c, d]} asLifQueue() 该方法用于将指定的Deque双端队列转换为后进先出LIFO队列 Testpublic void test_asLifQueue(){/*该方法用于将指定的Deque双端队列转换为后进先出LIFO队列。*/ArrayDequeString deque new ArrayDeque();deque.add(first);deque.add(second);deque.add(third);System.out.println(deque);//[first, second, third]QueueString queue Collections.asLifoQueue(deque);while (!queue.isEmpty()){String poll queue.poll();System.out.println(poll);//转换为后进先出LIFO队列时并不改变元素的顺序而是将Deque视为LIFO队列。因此在使用poll方法时仍然是按照Deque的顺序取出元素而不是按照后进先出的顺序。/*firstsecondthird*/}} binarySearch() 输入指定元素返回对应的下标 -5该元素不存在 Testpublic void test_binarySearch(){/*输入指定元素返回对应的下标-5该元素不存在*/ListInteger list Arrays.asList(1, 2, 3, 4);System.out.println(Collections.binarySearch(list, 1));//0System.out.println(Collections.binarySearch(list, 2));//1System.out.println(Collections.binarySearch(list, 5));//-5 表示不存在System.out.println(Collections.binarySearch(list, 8));//-5System.out.println(Collections.binarySearch(list, 11));//-5} copy() 将所有元素从一个列表复制到另一个列表。第一个参数是目标列表第二个是源列表 目标列表长度必须不小于源列表 Testpublic void test_copy(){/*将所有元素从一个列表复制到另一个列表。第一个参数是目标列表第二个是源列表* 目标列表长度必须不小于源列表*/ListInteger src Arrays.asList(1, 2, 3, 4);ListInteger dest Arrays.asList(0,0,0,0);Collections.copy(dest,src);System.out.println(dest);//[1, 2, 3, 4]ListObject dest1 Collections.emptyList();//造一个空列表/*Collections.copy(dest1,src);//报错目标列表长度小于源列表长度System.out.println(dest1);//IndexOutOfBoundsException: Source does not fit in dest*/ListObject dest2 Collections.nCopies(4, null);//会生成一个包含4个null元素的不可变列表System.out.println(dest2);//[null, null, null, null]/*Collections.copy(dest2,src);//报错UnsupportedOperationExceptionSystem.out.println(dest2);*/ArrayListInteger dest3 new ArrayList();dest3.add(0);dest3.add(0);dest3.add(0);dest3.add(0);dest3.add(0);Collections.copy(dest3,src);System.out.println(dest3);//[1, 2, 3, 4, 0]} disjoint() 判断两个集合是否完全不包含对方集合的元素         完全不包含返回 true。         哪怕包含1个都返回false Testpublic void test_disjoint(){/*判断两个集合是否完全不包含对方集合的元素完全不包含返回 true。哪怕包含1个都返回false*/ListInteger c1 Arrays.asList(1, 2, 3, 4);ListInteger c2 Arrays.asList(1, 2, 3, 4);System.out.println(Collections.disjoint(c1, c2));//falseListInteger c3 Arrays.asList(1, 5, 6);System.out.println(Collections.disjoint(c1, c3));//falseListInteger c4 Arrays.asList(7, 5, 6);System.out.println(Collections.disjoint(c1, c4));//true} emptyList() 返回一个不可变空列表 Testpublic void test_emptyList(){/*返回一个不可变空列表* 意义* 1. 节省内存由于空列表是不可变的可以在不需要实际数据的情况下节省内存空间。在某些场景下需要一个空列表作为占位符或默认返回值此时使用Collections.emptyList()可以避免创建多个空列表对象。2. 避免空指针异常在某些情况下需要返回一个空列表而不是null以避免空指针异常。使用Collections.emptyList()可以提供一个安全的空列表对象。3. API一致性在一些API设计中需要返回一个空列表作为特定情况的标识符使用Collections.emptyList()可以保持API的一致性和规范性。虽然Collections.emptyList()返回的空列表不能被修改但它在某些情况下仍然具有一定的实用性和意义。*/ListObject objects Collections.emptyList();System.out.println(objects);//[]// System.out.println(objects.add(dahua));//UnsupportedOperationException} emptyMap() 返回1个空的map不可变的 Testpublic void test_emptyMap(){/*返回1个空的map不可变的。*/MapObject, Object objectMap Collections.emptyMap();System.out.println(objectMap);//{}} emptySet() 返回1个空的set不可变的 Testpublic void test_emptySet(){/*返回1个空的set不可变的*/SetObject objectSet Collections.emptySet();System.out.println(objectSet);//[]} enumeration() 返回一个枚举类型的列表 Testpublic void test_enumeration(){/*返回一个枚举类型的列表*/ListString c Arrays.asList(dahua, xiaoyabing, sangxinran, fangmangmang);EnumerationString enumeration Collections.enumeration(c);System.out.println(enumeration);//java.util.Collections$33d82c5f3while (enumeration.hasMoreElements()){System.out.println(enumeration.nextElement());}/*dahuaxiaoyabingsangxinranfangmangmang*/} fill() 使用指定元素替换、填充指定列表中的所有元素 Testpublic void test_fill(){/*使用指定元素替换、填充指定列表中的所有元素*/ListString c Arrays.asList(dahua, xiaoxiao, xiaosang, xiaofang);Collections.fill(c,lgf);System.out.println(c);//[lgf, lgf, lgf, lgf]} frequency() 返回集合中指定对象的个数 Testpublic void test_frequency(){/*返回集合中指定对象的个数*/ListString c Arrays.asList(dahua, xiaoxiao, xiaosang, xiaofang,xiaofang);System.out.println(Collections.frequency(c, xiaofang));//2System.out.println(Collections.frequency(c, dahua));//1} indexOfSubList() 返回一个数组列表它按返回顺序包含指定枚举返回的元素 Testpublic void test_indexOfSubList(){/*返回指定源列表中第一次出现指定目标列表的起始位置如果没有出现这样的列表则返回 -1*/ListString src Arrays.asList(dahua, xiaoxiao, xiaosang, xiaofang,xiaofang);ListString target Arrays.asList(dahua, xiaoxiao, xiaosang, xiaofang,xiaofang);System.out.println(Collections.indexOfSubList(src, target));//0ListString target1 Arrays.asList(dahua, xiaoxiao, xiaosang, xiaofang,xiaofang,dahai);System.out.println(Collections.indexOfSubList(src, target1));//-1} list() 返回一个数组列表它按返回顺序包含指定枚举返回的元素 Testpublic void test_list(){/*返回一个数组列表它按返回顺序包含指定枚举返回的元素*/ListString c Arrays.asList(dahua, xiaoyabing, sangxinran, fangmangmang);EnumerationString enumeration Collections.enumeration(c);ArrayListString list Collections.list(enumeration);System.out.println(list);//[dahua, xiaoyabing, sangxinran, fangmangmang]VectorString vector new Vector();vector.add(Apple);vector.add(Banana);vector.add(Orange);EnumerationString elements vector.elements();ArrayListString list1 Collections.list(elements);System.out.println(list1);//[Apple, Banana, Orange]} max() 根据元素的自然顺序返回集合中的最大元素         *         * 也可以自定义排序规则 Testpublic void test_max(){/*根据元素的自然顺序返回集合中的最大元素** 也可以自定义排序规则*/ListString coll Arrays.asList(dahua, xiaoyabing, sangxinran, fangmangmang);System.out.println(Collections.max(coll));//xiaoyabing/*自定义大小规则第二个参数写比较器返回给定 集合 的最大元素*/String max Collections.max(coll, new ComparatorString() {Overridepublic int compare(String o1, String o2) {int i o1.substring(0).hashCode();int i1 o2.substring(0).hashCode();return i - i1;}});System.out.println(max);//fangmangmang} min() 返回集合最小元素 Testpublic void test_min(){/** 返回集合最小元素* */ // Collections.min()} nCopies() 返回由指定对象的 n 个副本组成的不可变列表 Testpublic void test_nCopies(){/*返回由指定对象的 n 个副本组成的不可变列表*/ListString dahua Collections.nCopies(5, dahua);System.out.println(dahua);//[dahua, dahua, dahua, dahua, dahua]ListObject objects Collections.nCopies(5, null);System.out.println(objects);//[null, null, null, null, null]/*objects.add(xiaomei);//UnsupportedOperationException不可变了System.out.println(objects);*/} newSetFromMap() 将Map转成set结构前提是map必须为空 Testpublic void test_newSetFromMap(){/*将Map转成set结构前提是map必须为空*/MapString, Boolean map new HashMap();map.put(Apple, true);map.put(Banana, false);map.put(Orange, true); // SetString set1 Collections.newSetFromMap(map);//IllegalArgumentException: Map is non-empty:map必须为空map.clear();SetString set Collections.newSetFromMap(map);} replaceAll() 用一个值替换集合原有子串 Testpublic void test_replaceAll(){/*我的用一个值替换集合原有子串官方使用另一个值替换列表中出现的所有某一指定值*/ListString list Arrays.asList(dahua, xiaoyabing, sangxinran, fangmangmang);Collections.replaceAll(list,dahua,xiaoliang);System.out.println(list);//[xiaoliang, xiaoyabing, sangxinran, fangmangmang]} reverse() 列表元素反转 Testpublic void test_reverse(){/*列表元素反转*/ListString list Arrays.asList(dahua, xiaoyabing, sangxinran, fangmangmang);Collections.reverse(list);System.out.println(list);//[fangmangmang, sangxinran, xiaoyabing, dahua]} rotate() 指定的距离循环滚动 Testpublic void test_rotate(){/*指定的距离循环滚动*/ListInteger list Arrays.asList(1, 2, 3, 4, 5);// 将列表向右循环移动2个位置第一个元素往右走两格Collections.rotate(list, 2);System.out.println(list);//[4, 5, 1, 2, 3]} shuffle() 将列表元素随机打乱 Testpublic void test_shuffle(){/*将列表元素随机打乱*/ListInteger list Arrays.asList(1, 2, 3, 4, 5);Collections.shuffle(list);System.out.println(list);//[3, 5, 4, 1, 2] 第一次运行结果System.out.println(list);//[2, 5, 4, 3, 1] 第二次运行结果System.out.println(list);//[4, 3, 2, 5, 1] 第三次运行结果} singleton() 返回一个只包含指定对象的不可变 set Testpublic void test_singleton(){/*返回一个只包含指定对象的不可变 set*/ListString list Arrays.asList(dahua, dahua, sangxinran, fangmangmang);SetListString singleton Collections.singleton(list);System.out.println(singleton);//[[dahua, dahua, sangxinran, fangmangmang]]}
http://www.dnsts.com.cn/news/2476.html

相关文章:

  • 驾校网站源码下载推广宣传文案
  • 清河做网站哪儿便宜百度北京总部电话
  • 照片做视频的软件 模板下载网站世界杯比分查询
  • 石家庄疫情最新消息今日新增搜索引擎优化的目的是
  • 灵宝超市建设管理局信访网站百度推广网页版
  • 非凡免费建网站平台凡科建站下载
  • 成都找人做网站泉州seo排名扣费
  • 成全视频免费观看在线看咸阳站群seo技巧
  • 有什么做家常菜的网站自建网站平台
  • b站大全不收费关键词seo
  • 做数据新闻的网站第一推广网
  • 美国一级a做爰片免费网站湖南长沙关键词推广电话
  • 建筑课程网站免费做网站网站的软件
  • 做网站都需要建哪些文件夹网页广告调词平台
  • 万州医院网站建设学计算机哪个培训机构好
  • 新手学做网站学哪些知识百度指数移动版app
  • 重庆忠县网站建设公司哪家专业怎么做微信小程序
  • 做网站的回扣百度网盘app官网
  • 姜堰哪里有网站建设的品牌网络推广怎么做
  • 县 住房和城乡建设局网站网时代教育培训机构怎么样
  • wordpress+4.5+多站点百度指数可以查询多长时间的
  • 网站如何自己做seo百度招聘2022年最新招聘
  • org域名做网站搜索引擎优化公司排行
  • 杭州企业网站优化营销策划是做什么
  • 四川已经取消48小时核酸检测安徽seo优化规则
  • wordpress设置为繁体字宁波seo外包
  • 南京营销网站开发制作报价搜索网页内容
  • 宝应县建设局网站最近一周的新闻
  • 嘉兴白酒网站建设网站底部友情链接
  • 高端网站设计技术分析网站搜索工具