Convert a List (ArrayList) to an Array with full length array
import java.util.ArrayList; import java.util.List; public class Main { public static void main(String[] args) { List<String> carList = new ArrayList<String>(); carList.add("A"); carList.add("B"); carList.add("C"); carList.add("D"); String[] carArray = carList.toArray(new String[0]); for (String car : carArray) { System.out.println(car); } } } /* A B C D */