Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The When processing a varargs method call, the Java compiler checks the type of the actual arguments to each variable arity (varargs) method to ensure that they match the arguments are of the same type or object reference. Howeverin the method definition. However, the compile-time checking is ineffective when Object or generic parameter types are used [Bloch 2008]. The presence of initial parameters of specific types is irrelevant; the compiler will remain unable to check Object or generic variable arity parameter types. Enable strong compile-time type checking of variable arity methods by using the most specific type possible for the type of the method parameter.

...