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

做网站需要多少钱 爱问知识人wordpress修改样式表

做网站需要多少钱 爱问知识人,wordpress修改样式表,58网站建设 网站制作,手机网站制作服务对于集合取交集、并集的处理其实有很多种方式,这里就介绍3种 第一种 是CollectionUtils工具类 第二种 是List自带方法 第三种 是JDK1.8 stream 新特性 1、CollectionUtils工具类 下面对于基本数据(包扩String)类型中的集合进行demo示例。 public static void main(String[]…对于集合取交集、并集的处理其实有很多种方式,这里就介绍3种 第一种 是CollectionUtils工具类 第二种 是List自带方法 第三种 是JDK1.8 stream 新特性 1、CollectionUtils工具类 下面对于基本数据(包扩String)类型中的集合进行demo示例。 public static void main(String[] args) {String[] arrayA new String[] { 1, 2, 3, 4};String[] arrayB new String[] { 3, 4, 5, 6 };ListString listA Arrays.asList(arrayA);ListString listB Arrays.asList(arrayB);//1、并集 unionSystem.out.println(CollectionUtils.union(listA, listB));//输出: [1, 2, 3, 4, 5, 6]//2、交集 intersectionSystem.out.println(CollectionUtils.intersection(listA, listB));//输出:[3, 4]//3、交集的补集析取disjunctionSystem.out.println(CollectionUtils.disjunction(listA, listB));//输出:[1, 2, 5, 6]//4、差集扣除System.out.println(CollectionUtils.subtract(listA, listB));//输出:[1, 2]} 2、List自带方法 public static void main(String[] args) {String[] arrayA new String[] { 1, 2, 3, 4};String[] arrayB new String[] { 3, 4, 5, 6 };ListString listA Arrays.asList(arrayA);ListString listB Arrays.asList(arrayB);//1、交集ListString jiaoList new ArrayList(listA);jiaoList.retainAll(listB);System.out.println(jiaoList);//输出:[3, 4]//2、差集ListString chaList new ArrayList(listA);chaList.removeAll(listB);System.out.println(chaList);//输出:[1, 2]//3、并集 (先做差集再做添加所有ListString bingList new ArrayList(listA);bingList.removeAll(listB); // bingList为 [1, 2]bingList.addAll(listB); //添加[3,4,5,6]System.out.println(bingList);//输出:[1, 2, 3, 4, 5, 6]} 注意 : intersection和retainAll的差别 它们的返回类型是不一样的,intersection返回的是一个新的List集合而retainAll返回是Bollean类型。 那就说明retainAll方法是对原有集合进行处理再返回原有集合,会改变原有集合中的内容。 注意 : Arrays.asList将数组转集合不能进行add和remove操作。 原因调用Arrays.asList()生产的List的add、remove方法时报异常这是由Arrays.asList() 返回的市Arrays的内部类ArrayList 而不是java.util.ArrayList。 所以正确做法如下 String[] array {1,2,3,4,5};ListString list Arrays.asList(array);List arrList new ArrayList(list);arrList.add(6); 3、JDK1.8 stream 新特性 public static void main(String[] args) {String[] arrayA new String[] { 1, 2, 3, 4};String[] arrayB new String[] { 3, 4, 5, 6 };ListString listA Arrays.asList(arrayA);ListString listB Arrays.asList(arrayB);// 交集ListString intersection listA.stream().filter(item - listB.contains(item)).collect(toList());System.out.println(intersection);//输出:[3, 4]// 差集 (list1 - list2)ListString reduceList listA.stream().filter(item - !listB.contains(item)).collect(toList());System.out.println(reduceList);//输出:[1, 2]// 并集 新建集合:1、是因为不影响原始集合。2、Arrays.asList不能add和remove操作。ListString listAll listA.parallelStream().collect(toList());ListString listAll2 listB.parallelStream().collect(toList());listAll.addAll(listAll2);System.out.println(listAll);//输出:[1, 2, 3, 4, 3, 4, 5, 6]// 去重并集 ListString list new ArrayList(listA);list.addAll(listB);ListString listAllDistinct list.stream().distinct().collect(toList());System.out.println(listAllDistinct);//输出:[1, 2, 3, 4, 5, 6]} 总结 第一种方式常用因为第二种还需要确定该集合是否被多次调用。第三种可读性不高。
文章转载自:
http://www.morning.hxsdh.cn.gov.cn.hxsdh.cn
http://www.morning.ljwyc.cn.gov.cn.ljwyc.cn
http://www.morning.yprjy.cn.gov.cn.yprjy.cn
http://www.morning.bqwrn.cn.gov.cn.bqwrn.cn
http://www.morning.jppdk.cn.gov.cn.jppdk.cn
http://www.morning.zkjqj.cn.gov.cn.zkjqj.cn
http://www.morning.mtqqx.cn.gov.cn.mtqqx.cn
http://www.morning.ljbm.cn.gov.cn.ljbm.cn
http://www.morning.xlbtz.cn.gov.cn.xlbtz.cn
http://www.morning.lmjkn.cn.gov.cn.lmjkn.cn
http://www.morning.nwzcf.cn.gov.cn.nwzcf.cn
http://www.morning.jrksk.cn.gov.cn.jrksk.cn
http://www.morning.xprzq.cn.gov.cn.xprzq.cn
http://www.morning.ytmx.cn.gov.cn.ytmx.cn
http://www.morning.qykxj.cn.gov.cn.qykxj.cn
http://www.morning.zfqdt.cn.gov.cn.zfqdt.cn
http://www.morning.wlggr.cn.gov.cn.wlggr.cn
http://www.morning.ckxd.cn.gov.cn.ckxd.cn
http://www.morning.grynb.cn.gov.cn.grynb.cn
http://www.morning.ghcfx.cn.gov.cn.ghcfx.cn
http://www.morning.gblrn.cn.gov.cn.gblrn.cn
http://www.morning.tqbyw.cn.gov.cn.tqbyw.cn
http://www.morning.kmwsz.cn.gov.cn.kmwsz.cn
http://www.morning.xwgbr.cn.gov.cn.xwgbr.cn
http://www.morning.tmcmj.cn.gov.cn.tmcmj.cn
http://www.morning.fbmzm.cn.gov.cn.fbmzm.cn
http://www.morning.kwxr.cn.gov.cn.kwxr.cn
http://www.morning.bby45.cn.gov.cn.bby45.cn
http://www.morning.taojava.cn.gov.cn.taojava.cn
http://www.morning.fdrwk.cn.gov.cn.fdrwk.cn
http://www.morning.gprzp.cn.gov.cn.gprzp.cn
http://www.morning.mtgnd.cn.gov.cn.mtgnd.cn
http://www.morning.hwnqg.cn.gov.cn.hwnqg.cn
http://www.morning.iterlog.com.gov.cn.iterlog.com
http://www.morning.jxpwr.cn.gov.cn.jxpwr.cn
http://www.morning.bqqzg.cn.gov.cn.bqqzg.cn
http://www.morning.sskhm.cn.gov.cn.sskhm.cn
http://www.morning.nkddq.cn.gov.cn.nkddq.cn
http://www.morning.bwxph.cn.gov.cn.bwxph.cn
http://www.morning.mtrz.cn.gov.cn.mtrz.cn
http://www.morning.dfbeer.com.gov.cn.dfbeer.com
http://www.morning.gtqws.cn.gov.cn.gtqws.cn
http://www.morning.kcnjz.cn.gov.cn.kcnjz.cn
http://www.morning.qbwyd.cn.gov.cn.qbwyd.cn
http://www.morning.kpgft.cn.gov.cn.kpgft.cn
http://www.morning.ggnfy.cn.gov.cn.ggnfy.cn
http://www.morning.sjwqr.cn.gov.cn.sjwqr.cn
http://www.morning.pymff.cn.gov.cn.pymff.cn
http://www.morning.rjnx.cn.gov.cn.rjnx.cn
http://www.morning.gjmll.cn.gov.cn.gjmll.cn
http://www.morning.nhzxr.cn.gov.cn.nhzxr.cn
http://www.morning.lonlie.com.gov.cn.lonlie.com
http://www.morning.lmrjn.cn.gov.cn.lmrjn.cn
http://www.morning.dfqmy.cn.gov.cn.dfqmy.cn
http://www.morning.wsrcy.cn.gov.cn.wsrcy.cn
http://www.morning.xdfkrd.cn.gov.cn.xdfkrd.cn
http://www.morning.dmjhp.cn.gov.cn.dmjhp.cn
http://www.morning.wdpt.cn.gov.cn.wdpt.cn
http://www.morning.ppwdh.cn.gov.cn.ppwdh.cn
http://www.morning.rrms.cn.gov.cn.rrms.cn
http://www.morning.bksbx.cn.gov.cn.bksbx.cn
http://www.morning.qkqpy.cn.gov.cn.qkqpy.cn
http://www.morning.lsfrc.cn.gov.cn.lsfrc.cn
http://www.morning.tgxrm.cn.gov.cn.tgxrm.cn
http://www.morning.mkpkz.cn.gov.cn.mkpkz.cn
http://www.morning.rhmk.cn.gov.cn.rhmk.cn
http://www.morning.xxzjb.cn.gov.cn.xxzjb.cn
http://www.morning.qcwrm.cn.gov.cn.qcwrm.cn
http://www.morning.ccyns.cn.gov.cn.ccyns.cn
http://www.morning.fylqz.cn.gov.cn.fylqz.cn
http://www.morning.nbgfk.cn.gov.cn.nbgfk.cn
http://www.morning.leeong.com.gov.cn.leeong.com
http://www.morning.yqtry.cn.gov.cn.yqtry.cn
http://www.morning.mdmqg.cn.gov.cn.mdmqg.cn
http://www.morning.lxcwh.cn.gov.cn.lxcwh.cn
http://www.morning.xlztn.cn.gov.cn.xlztn.cn
http://www.morning.wmyqw.com.gov.cn.wmyqw.com
http://www.morning.tlbdy.cn.gov.cn.tlbdy.cn
http://www.morning.jcfg.cn.gov.cn.jcfg.cn
http://www.morning.xckdn.cn.gov.cn.xckdn.cn
http://www.tj-hxxt.cn/news/267268.html

相关文章:

  • php asp网站开发教程常州网站建设优质商家
  • 天堂资源地址在线下载班级优化大师免费下载
  • 怎么创建一个公司网站seo对网店的作用有哪些
  • 做预算查市场价格的网站本地广东中山网站建设
  • 创业初期要建立公司的网站吗手机网站内容规划
  • 随州网站建设哪家便宜成都网站制作-中国互联
  • 手机网站meta做58同城网站花了多少钱
  • 建立一个网站要多久开发直播软件需要多少钱
  • 如何查网站的备案号北京seo百科
  • 年栾洪全单页做网站教程效果图是怎么做出来的
  • 冷色调网站广州短视频制作运营
  • seo网站运营域名备案中网站可以开通
  • 嘉兴手机网站开发费用网站开发工作要求
  • 广东省交通建设监理检测协会网站dede 转wordpress
  • 3g 手机网站建设网站积分系统方案
  • 河南城乡住房和建设厅网站吉林省建设厅网站查询
  • 网站上线稳定后的工作wordpress通过数据库重置账号面膜
  • 建设增塑剂网站网页设计与应用论文
  • 温州网站建设维护wordpress 菜单 无效
  • 江西专业的网站建设公司免费ai设计logo网站
  • 购物网站图片的放大怎么做的给我看高清的视频在线观看
  • 网站建设合同应注意什么网页设计教程电子书
  • 个人网站是什么意思小程序商城开发说明
  • 在网站上卖东西怎么做响应式网页模版
  • wordpress 4.5.7漏洞太原百度搜索排名优化
  • 网站安全维护包括什么购物网站为什么做移动端
  • 网站建设方案机构做网站前端需要懂得
  • 做股东变更要上哪个网站长沙网页制作
  • 潍坊寿光网站建设租云服务器一个月多少钱
  • 企业网站名备案wordpress相册移植typecho