array to list# Java - 爪哇娇娃
s*y
1 楼
Hi I have a stupid question: how to convert an array to a list?
For example, I want to convert double [] a = {1.0, 2.0}; to a type of List<
Double>.
How to do it without using a loop to visit every element in the array?
I tried Arrays.asList but got an "incompatible type" error message.
Thanks
For example, I want to convert double [] a = {1.0, 2.0}; to a type of List<
Double>.
How to do it without using a loop to visit every element in the array?
I tried Arrays.asList but got an "incompatible type" error message.
Thanks