How to convert int[] into List in Java?

后端 未结 20 2382
萌比男神i
萌比男神i 2020-11-22 06:18

How do I convert int[] into List in Java?

Of course, I\'m interested in any other answer than doing it in a loop, item by it

20条回答
  •  误落风尘
    2020-11-22 06:49

    It's also worth checking out this bug report, which was closed with reason "Not a defect" and the following text:

    "Autoboxing of entire arrays is not specified behavior, for good reason. It can be prohibitively expensive for large arrays."

提交回复
热议问题