Java Reference
In-Depth Information
Here, there is an attempt to declare a regular parameter after the varargs parameter, which
is illegal. There is one more restriction to be aware of: there must be only one varargs para-
meter. For example, this declaration is also invalid:
The attempt to declare the second varargs parameter is illegal.
Overloading Varargs Methods
You can overload a method that takes a variable-length argument. For example, the follow-
ing program overloads vaTest( ) three times:
Search WWH ::




Custom Search