Converting array to list in Java - Stack Overflow
In your example, it is because you can't have a List of a primitive type. In other words, List<int>
is not possible. You can, however, have a List<Integer>
.
Integer[] spam = new Integer[] { 1, 2, 3 }; Arrays.asList(spam);
That works as expected.
Read full article from Converting array to list in Java - Stack Overflow
No comments:
Post a Comment