Only one variable parameter can be specified in a method, and it must be the last parameter of the method. Any ordinary arguments must be declared before it.

1.1 Variable parameter Format

Variable parameter format: typeName… ParameterName Example: String… Args variables are treated as arrays in methods.

1.2 Four modes of variable parameter Transmission

  1. Nothing is passed, the variable argument receives an array of length 0;
  2. passnullValue;
  3. The array;
  4. One or more parameters;

1.3 Differences between mutable parameters and arrays

  1. In terms of the number of variables, there can only be one variable parameter, and there can be multiple arrays.
  2. Mutable arguments can only be defined at the end of the argument list, and arrays can be anywhere;
  3. Mutable arguments can be passed to arrays, NULL, zero arguments, one to more arguments, and arrays can be passed to array references, array objects, and NULL