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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…