把四个集合里面的内容都存入一个集合(最后的集合已经有了四个集合的set,get方法了)
怎么四变一
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
addAll() doesn’t work...
Are the generics of these four collections the same?
If the generics are consistent, use the addall() method to add it to a new List. If you need to remove duplicates, use Set’s addall ()
Write a wrapper collection class and delegate to the corresponding sub-collection as needed. Usually just inherit AbstractList, and the constructor puts four or more sub-collections in.
It is recommended that you go to Google's guava toolkit... There are ready-made ones...
addAll() is enough
addAll() doesn’t work...
Are the generics of these four collections the same?
If the generics are consistent, use the addall() method to add it to a new List. If you need to remove duplicates, use Set’s addall ()
Write a wrapper collection class and delegate to the corresponding sub-collection as needed.
Usually just inherit AbstractList, and the constructor puts four or more sub-collections in.
It is recommended that you go to Google's guava toolkit... There are ready-made ones...
addAll() is enough