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
so that the method parameter looks like an array but allows everyone using the method to pass as many parameters of that type as the caller wants.
I'm fairly sure Java supports similar behaviour, but I cant find out how to do it.
See Question&Answers more detail:os