In c# if you want a method to have an indeterminate number of parameters you can make the final parameter in the method signature a "params" which to the method looks like an array but allows anyone using the method to put in as many parameters of that type as the want.
I'm fairly sure java supports similar behaviour, but I cant find out how to do it.