Section 7.13 Variable-Length Argument Lists

• An argument type followed by an ellipsis (...; p. 281) in a method’s parameter list indicates that the method receives a variable number of arguments of that particular type. The ellipsis can occur only once in a method’s parameter list. It must be at the end of the parameter list.

• A variable-length argument list (p. 281) is treated as an array within the method body. The number of arguments in the array can be obtained using the array’s length field.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.