J
Jerry S
I've got a method that returns an array of Ints. What's the most
sensible way of copying them to a new ArrayList?
Thanks!
Jerry
sensible way of copying them to a new ArrayList?
Thanks!
Jerry
Hi Jerry,
The ArrayList has a constructor that takes a collection as input.
int []items = {1,2,3,4,5};
ArrayList items2 = new ArrayList(items);
Chris
Jerry S said:I've got a method that returns an array of Ints. What's the most
sensible way of copying them to a new ArrayList?
Thanks!
Jerry
Hi Jerry,
The ArrayList has a constructor that takes a collection as input.
int []items = {1,2,3,4,5};
ArrayList items2 = new ArrayList(items);
Chris
Jerry S said:I've got a method that returns an array of Ints. What's the most
sensible way of copying them to a new ArrayList?
Thanks!
Jerry
I've got a method that returns an array of Ints.
What's the most sensible way of copying them to
a new ArrayList?