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

网站如何后台管理北京正规网站建设有几种

网站如何后台管理,北京正规网站建设有几种,宁夏做网站公司,图片类网站怎样做高并发集合操作的工具类: 1):Arrays类: 2):Collections类. Arrays类: 在Collection接口中有一个方法叫toArray把集合转换为Object数组. 把集合转换为数组: Object[] arr 集合对象.toArray(); 数组也可以转换为集合(List集合): public static List asList(T… a) 等价于public …集合操作的工具类: 1):Arrays类: 2):Collections类. Arrays类: 在Collection接口中有一个方法叫toArray把集合转换为Object数组. 把集合转换为数组: Object[] arr 集合对象.toArray(); 数组也可以转换为集合(List集合): public static List asList(T… a) 等价于public static List asList(T[] a). 通过Arrays.asList方法得到的List对象的长度是固定的,不能增,也不能减. 为什么: asList方法返回的ArrayList对象,不是java.util.ArrayList而是Arrays类中的内部类对象. 面试题:Collection和Collections的区别. Collections类:封装了Set,List,Map的操作的工具方法. 获取空集对象(没有元素的集合,注意集合不为null): 常用的集合类: HashSet/ArrayList/HashMap都是线程不安全的,在多线程环境下不安全. 在Collections类中有获取线程安全的集合方法: List list Collections.synchronizedList(new ArrayList()); 当要做迭代的时候得使用synchronized. synchronized(list) { TODO } Set set Collections.synchronizedSet(new HashSet()); Map map Collections.synchronizedMap(new HashMap()); Java.util.Collections类下有一个静态的shuffle()方法,如下 1static void shuffle(List package ahu; import java.util.*; public class Modify { public static void main(String[] args){ Random randnew Random(47); Integer[] ia{0,1,2,3,4,5,6,7,8,9}; ListInteger listnew ArrayListInteger(Arrays.asList(ia)); System.out.println(Before shufflig: list); Collections.shuffle(list,rand); System.out.println(After shuffling: list); System.out.println(array: Arrays.toString(ia)); ListInteger list1Arrays.asList(ia); System.out.println(Before shuffling: list1); Collections.shuffle(list1,rand); System.out.println(After shuffling: list1); System.out.println(array: Arrays.toString(ia)); } } output Before shufflig: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] After shuffling: [3, 5, 2, 0, 7, 6, 1, 4, 9, 8] array: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Before shuffling: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] After shuffling: [8, 0, 5, 2, 6, 1, 4, 9, 3, 7] array: [8, 0, 5, 2, 6, 1, 4, 9, 3, 7] Collections.shuffle()方法可用在游戏随机发牌中 代码 package com.test;import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Random;//线程安全 public class Main { public static void main(String[] args){ Character[] a {1,2,3,4,5,6,7,8,9,J,Q,K};ListCharacter list new ArrayList(Arrays.asList(a));Collections.shuffle(list);for (Character string : list) {System.out.println(string);}} }
http://www.zqtcl.cn/news/930893/

相关文章:

  • 临沂网站排名高质量的中山网站建设
  • 响应式网站定制开发网络教育全程托管
  • 做网站中的剪辑图片龙岗网站
  • 建设购物网站的意义免费做外贸的网站平台
  • 长沙做电商网站设计重庆观音桥旅游攻略
  • 网站建设的目标与期望动漫设计与制作工资多少
  • 做网站找网站设计公司 长沙
  • 网站维护内容网站代码下载
  • 西安建设主管部门官方网站wordpress返回件
  • 建立免费空间网站南宁seo推广外包
  • 网站初期如何推广用秀米制作h5详细步骤
  • 做网站需要执照嘛开发 网站 团队
  • 怎么提交网站关键词包头人脸检测系统
  • 哪个网站开发是按月付费的婚纱摄影建设网站的目的
  • 站长之家app简单网站制作步骤
  • 网站开发与桌面应用开发wordpress if include
  • 网站怎么做预约小程序江苏省工程建设招标网站
  • python做网站有什么弊端专业做网带
  • 浙江建设工程考试网站wordpress等模版比较
  • seo网站论文高端疫苗
  • 山东省城乡住房和建设厅网站首页贵阳网站建设技术托管
  • 免费的网站申请做电影网站被告版权
  • 网站后台显示不全百姓网招聘信息最新招聘
  • 前端手机网站同企网站建设做网站
  • 重庆专业网站公司查看网站是否收录
  • 网站怎么做网上报名学多久可以做网站 知乎
  • 网站建设项目总结报告织梦模板建站
  • 关于网站建设的基础知识中石化十建公司官网
  • 江苏做网站怎么收费wordpress的wap插件
  • 企业营销网站建设公司哪家好网站建设团队名称