Is it possible to do this:
void foo(Bar b, FooBar fb){
Object[] args=getArgs() //Contains the parameters b & fb
}
And if yes, how?
(I dont know the name and the number of parameters)
No, Java does not support a simple, generic way to pack all the method arguments into an array. This is pretty standard for statically typed programming languages. It's generally dynamic languages like JavaScript and shell scripting languages that do allow retrieving all the arguments as an array.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With