You can pass all similar type values in the function while calling it.
In the function definition put a array so that all the passed values can be collected in that array.
e.g.
.
static void demo (String ... stringArray) {
your code goes here where read the array stringArray
}