The Spring framework uses methods where you can pass as many arguments as you like.
I would like to write a function that can also take an unlimited amount of data. How is this feature called so that I can read about it? Or how can I define it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s called varargs.
It allows a method to take any number of arguments. They are accessible as an array in the method:
This is syntactic sugar. The compiler hides the array creation, so instead of
you write