我有List<SomePojo> firstList = new ArrayList<SomePojo>();
如何复制othertype列表的一个usertype列表?
// add 100 SomePojo objects to list。 现在列表中有100个对象。
如果我创建下面多了一个实例:
List<SomeOtherPojo> secondList = new ArrayList<SomeOtherPojo>();
这里,SomePojo和SomeOtherPojo内部具有相同的公共变量。 如何将firstList的内容复制到secondList? 有什么办法可以做到吗?
任何帮助,将不胜感激。
'SomePojo'和'SomeOtherPojo'是否有共同界面或超类? – Fusselchen