A “varargs” method argument allows callers of that method to specify multiple arguments of the designated type, each as a separate argument. It is specified in the method declaration by three ASCII periods (
...) after the base type.
The method itself receives those arguments as a single array, whose element type is the type of the varargs argument. The array is created automatically (though callers are still permitted to pass an explicit array instead of passing multiple values as separate method arguments).
Rules for varargs:
You must follow above rules otherwise program will give compile error.