is it possible to create a function in java that supports any number of parameters and then to be able to iterate through each of the parameter provided to the function ?
As other have pointed out you can use Varargs:
void myMethod(Object... args)
This is actually equivalent to:
void myMethod(Object[] args)
In fact the compiler converts the first form to the second - there is no difference in byte code. All arguments must be of the same type, so if you want to use arguments with different types you need to use an Object type and do the necessary casting.