给定一个类型为Element[]
的数组:
Element[] array = {new Element(1), new Element(2), new Element(3)};
如何将这个数组转换为类型为ArrayList<Element>
的对象?
ArrayList<Element> arrayList = ???;
将数组转换为ArrayList:
new ArrayList<>(Arrays.asList(array));
标签:转换,ArrayList,Element,数组,new,array
From: https://www.cnblogs.com/xiaomandujia/p/17773285.html