I have an Arraylist that I want to convert to a double[] array. I first convert the Arraylist to a String []. I then try to convert the String[] to a double[] but fail in the p
Use this
String[] str1 = new String[list1.size()]; str1 = list1.toArray(str1); double[] doubleArray = new double[str1.length] int i=0; for(String s:str1){ doubleArray[i] = Double.valueOf(s.trim()); i++; }