您的当前位置:首页正文

java--新建list并赋值

来源:华佗健康网
java--新建list并赋值

数组初始化 时候的赋值

String[] strings = new String[]{ \"one\ };  

list 初始化时候的赋值

List a = new ArrayList() {//这个⼤括号 就相当于我们 new 接⼝ {//这个⼤括号 就是 构造代码块 会在构造函数前 调⽤ this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); this.add(\"ZBP3100019\"); } };  

因篇幅问题不能全部显示,请点此查看更多更全内容