How to cast from List to double[] in Java?

前端 未结 7 556
野性不改
野性不改 2020-11-28 13:18

I have a variable like that:

List frameList =  new ArrayList();

/* Double elements has added to frameList */

H

7条回答
  •  忘掉有多难
    2020-11-28 13:57

    You can convert to a Double[] by calling frameList.toArray(new Double[frameList.size()]), but you'll need to iterate the list/array to convert to double[]

提交回复
热议问题