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
You need to split each String in list1 on "," and attempt to parse each String that gets split out:
ArrayList results = Lists.newArrayList();
for( String s : list1 ) {
String[] splitStrings = s.split(",");
Double[] doublesForCurrentString = new Double[splitStrings.length];
for(int i=0; i
Crucial points:
ArrayList
(or ArrayList>
) over Double[]
or Double[][]
any day of the week. There are certainly situations where I'd do differently, but yours doesn't sound like one of them to me.