内容导航:
1、
collections
2、
Collections.singletonList和Arrays.asList的区别
1、
collections
英:
美:
常见释义:
n.收集(collection的复数);集合物件
1、And the drawing archive, surely one of the great architectural
collections
, is now free of paranoia and eager to share its treasures.───这个绘画藏馆无疑是最伟大的建筑之一,现在它已经不再偏执多疑,而是渴望和大家分享它的珍藏。
2、One of the private art
collections
Isabella visited in Milan had a deep influence on her.───伊莎贝拉在参观米兰时看到了一个私人艺术品收藏,这深深地影响到了她。
3、Chris Morris wants to cash a check his mother sent him for his birthday . He is talking to the
collections
clerk at the First National Bank.───克里斯·莫里斯想兑换一张他母亲为庆祝他的生日寄来的支票,他正与第一国民银行的负责托收的职员谈话。
4、Some
collections
can become very valuable.───有些收藏品会变得非常有价值。
5、Some see their
collections
as a valuable investment.───有些人认为他们的收藏是一项有价值的投资。
6、Rise to the sky look, little bit of the stars as if
collections
of pearl inlaid in the Canopy, the sparkle in the light hair.───抬头往天上望,点点的繁星好似颗颗明珠,镶嵌在天幕下,闪闪地发着光。
7、His abstracts are held in numerous
collections
.───他的抽象画被纳入到很多收藏中。
8、Before long, many of these would undoubtedly end up in unscrupulous private and public
collections
of the affluent nations.───不久后,大量的文物毫无疑问的会落在富裕国家里一些不择手段的私人收藏家和收藏机构手里。
9、Users of the Amazon and Google services have to upload their
collections
first, which can be a time-consuming process.───而使用亚马逊和谷歌服务的用户必须首先上传他们收藏的曲目,这个过程可能比较耗时。
1、confections───n.糖果(confection的复数);零食;小吃;糖果剂
2、collectors───n.收藏家;收集者;聚集剂;【电子】集电极(collector的复数)
3、collocations───n.搭配;配置;搭配词(collocation的复数);并列
4、collection───n.采集,聚集;【税收】征收;收藏品;募捐
5、collectives───adj.集体的;共同的;集合的;集体主义的;n.集团;集合体;集合名词
6、collecting───聚集;收集(collect的现在分词)
7、collations───n.校对;便餐;斋日的点心;牧师职务;排列规则
8、recollections───n.回忆;记忆(recollection的复数形式)
9、bolections───n.凸嵌线
2、
Collections.singletonList和Arrays.asList的区别
1. 调用Collections.singletonList(T o)方法其实是创建了一个SingletonList对象,SingletonList继承了抽象类AbstractList
2. SingletonList最大的特点是整个集合中只能有一个元素,不能调用add方法
3. SingletonList中唯一的一个元素可以设置为null
4. 由于SingletonList中唯一的一个元素是final类型的,所以一旦被初始化完成后就不可以进行修改,只能通过各种不同的方式来进行读取这个唯一的元素
1. 调用 Arrays.asList(T… a)方法其实是创建了一个 ArrayList 对象,ArrayList 继承了抽象类 AbstractList
2. ArrayList 最大的特点是整个集合允许有多个元素存入数组中,但是一旦初始化后,数组的长度就不可以再进行任何的更改,但是数组中的元素可以修改
3. ArrayList 中的传入的数组参数中允许存在null,但是不允许只有一个null
4. 由于 ArrayList 中存储数组是final类型的,所以一旦被初始化完成后长度就不可以进行修改,所以我们可以去遍历、修改 ArrayList 中的元素但不能去增加、删除
1. Collections.singletonList 和 Arrays.asList 都是长度不可变的集合,Collections.singletonList 长度为1,元素初始化完成就不可修改, Arrays.asList 长度不可变,元素初始化完成还可以进行修改
2. Collections.singletonList 中的唯一一个元素可以是null,但是如果 Arrays.asList 只存入一个元素的话,那就一定不允许为null,否则的话会抛出 NullPointerException 异常
3. Arrays.asList 中创建的 ArrayList 和我们常用的java.util.ArrayList并不是同一个,所以不要以为 java.util.ArrayList 中可以使用的方法在 Arrays.asList 中也都可以使用,否则的话分分钟教你重新做人
4. Collections.singletonList 中保存元素的是一个对象, Arrays.asList 中保存元素的是一个数组,在这一点上,它俩的差别还是很大的,当然,如果你喜欢,也可以在 Collections.singletonList中保存一个数组对象