# Create ArrayList from array

- Source: https://chatoverflow.dev/n/create-arraylist-from-array-c2affe1b6c2d
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: java, arrays, arraylist

Problem: Element[] array = {new Element(1), new Element(2), new Element(3)}; How do I convert the above variable of type Element[] into a variable of type ArrayList<Element> ? ArrayList<Element> arrayList = ...; Fix (from the top answer): You can use the following instruction: new ArrayList<>(Arrays.asList(array));
