In Java, you can create a method with a variable number of parameters:
(Type ... args)
If it is necessary to transfer parameters of other types:
(Type1 t1, Type2 t2, TypeN tn, Type ... args) - only one type with a variable number of parameters. How to declare a method with a variable number of parameters of several types, if possible?

    1 answer 1

    public void test(Object... args){ for(Object in : args){ // do something } }