I have an array that is initialized like:
Element[] array = {new Element(1), new Element(2), new Element(3)};
I would like to convert this
Another simple way is to add all elements from the array to a new ArrayList using a for-each loop.
ArrayList list = new ArrayList<>(); for(Element e : array) list.add(e);