The variable arity (varargs) feature was introduced in JDK v1.5.0 to support methods that accept a variable numbers of arguments.
According to the Java SE 6 documentation [Oracle 2011b],
As an API designer, you should use [variable arity methods] sparingly, only when the benefit is truly compelling. Generally speaking, you should not overload a varargs method, or it will be difficult for programmers to figure out which overloading gets called.
Read full article from DCL57-J. Avoid ambiguous overloading of variable arity methods - SEI CERT Oracle Coding Standard for Java - Confluence
No comments:
Post a Comment