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
This will do the work.
double[] doubles = new double[array1.length];
for(int i=0; i
Thanks SmartLemon for the edit, you could do this too instead of using a String[]
:
double[] doubles = new double[list1.size()];
for(int i=0; i
EDIT: So yes, you need a delimiter:
double[] doubles = new double[array1.length*2]; //multiply by 2 because you really have 8 numbers not 4
String [] array2 = null;
for(String string: array1) {
array2 = string.split(",");
for(int i=0; i
this should do the work for sure.