How to: How to convert an ArrayList containing Integers to primitive int array?
How to: How to convert an ArrayList containing Integers to primitive int array?
How to convert an ArrayList containing Integers to primitive int array?
I’m trying to convert an ArrayList containing Integer objects to primitive int[] with the following piece of code, but it is throwing compile time error. Is it possible to convert in Java?
List<Integer> x = new ArrayList<Integer>(); int[] n = (int[])x.toArray(int[x.size()]);
Answer: How to convert an ArrayList containing…
View On WordPress









