When I try to convert a double array to a Double arrayList I got the following error:
Exception in thread "main" java.lang.ClassCastException: [D cannot be cast to java.lang.Double
Below is my code.
double [] firstValueArray ;
ArrayList <Double> firstValueList = new ArrayList (Arrays.asList(firstValueArray));
I am comparing this list with another list and assign the result to another double variable.
Please let me know the reason for this error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…