As of Java 5, methods can declare a parameter that accepts from zero to many arguments, a so-called var-arg method.
A var-arg parameter is declared with the syntax type... name; for instance: doStuff(int... x) { }
A var-arg method can have only one var-arg parameter.
In methods with normal parameters and a var-arg, the var-arg must come last.
A var-arg parameter is declared with the syntax type... name; for instance: doStuff(int... x) { }
A var-arg method can have only one var-arg parameter.
In methods with normal parameters and a var-arg, the var-arg must come last.
No comments:
Post a Comment