Check out example codes for "java take arbitrary number of arguments". It will help you in understanding the concepts better.

Code Example 1

// In order to define vararg, ... (three dots) is used in the formal 
// parameter of a method. This essentially creates an array.

accessModifier methodName(datatype… arg) {
    // method body
}

Learn ReactJs, React Native from akashmittal.com