Essentially, I want to have a method:
public void setArgs(String... vals)
{
for (String s: vals)
// Here I can add s every string passed to an array list
The thing I'm wondering is: can I simply store all of the arguments passed to setArgs in an Array, instead of bothering with an ArrayList? I know arrays are immutable in java, so I was wondering if you can somehow there's an easy way to extract the arguments without using a loop.
Thanks.
> I know arrays are immutable in javaArrays are mutable, array size is not"can I simply store all of the arguments passed to setArgs in an Array, instead of bothering with an ArrayList"I think you mean the other way around.