OK, so, first, apologies to @JBNizet for blatant code stealing (original URL to the stolen code: here).
The thing is that Java 5's varargs is just syntactic sugar for an array. Witness this code:
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
foo(args);
}
private static void foo(String... params) {
System.out.println(Arrays.toString(params));
}
}
It works. It would have worked the same if instead you had used a varargs in main()
and an array in foo()
.
So, in UML, you can model varargs as an array.