Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { /** * create new Array and copy from {@code src} to it. no effect to * {@code src}. */ static public long[] new_array_from(ArrayList<Long> src) { final long[] dest = new long[src.size()]; for (int i = 0; i < src.size(); ++i) { dest[i] = src.get(i).longValue(); } return dest; } }