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");
				}
			};

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM