java--新建list 并赋值

数组初始化 时候的赋值

 

String[] strings = new String[]{
              "one","two","three"
        };

  

 

list 初始化时候的赋值

 

List<String> a = new ArrayList<String>() {//这个大括号 就相当于我们  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");
				}
			};

  

posted @ 2019-08-21 16:25  walkerluo  阅读(24164)  评论(0编辑  收藏  举报