我有一个初始化如下的数组:
Element[] array = {new Element(1), new Element(2), new Element(3)};
我想将此数组转换为ArrayList
类的对象.
ArrayList<Element> arraylist = ???;
我有一个初始化如下的数组:
Element[] array = {new Element(1), new Element(2), new Element(3)};
我想将此数组转换为ArrayList
类的对象.
ArrayList<Element> arraylist = ???;
new ArrayList<>(Arrays.asList(array));