I want to pass a diffrent number of strings to a function in java, it suppose to be the strings to filter a query by, it could be 2-4 strings.
What do you think will be the best way to do that?
a) creating an overload for the same function with different number of parameters?
b) create a new instance of an array of string and pass it to the function?
any other preffered way?
thanks
Java has supported variable argument lists since 1.5:
The rules are simple: