I want to put int[] in the list, how do I do it?
collections java array boxing autoboxing
int[] ints = {1, 2, 3};
List<Integer> intList = new ArrayList<Integer>();
for (int index = 0; index < ints.length; index++)
{
intList.add(ints[index]);
}
You can do it like this.
© 2024 OneMinuteCode. All rights reserved.