Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.9k views
in Technique[技术] by (71.8m points)

java 数组申明区别

List<String>[] AssociatedCompany = (List<String>[]) new ArrayList<?>[]{};
List newList = new ArrayList<String>();

为啥上面这个申明没有add 添加元素的方法,下面这个就有add 方法呢?这是为啥?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

兄弟系统学习一下语法吧…
下面的是List,上面的是List的数组


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...