I\'m trying to convert an ArrayList containing Integer objects to primitive int[] with the following piece of code, but it is throwing compile time error. Is it possible to
Next lines you can find convertion from int[] -> List -> int[]
private static int[] convert(int[] arr) { List myList=new ArrayList(); for(int number:arr){ myList.add(number); } } int[] myArray=new int[myList.size()]; for(int i=0;i