How do I declare a method to accept a variable argument list?

John Zukowski

Methods like printf allow you to pass multiple arguments to a method without having to explicitly declare versions for each "count" of arguments. For the final parameter type, use three periods, as in Object.... You can also still specify the final argument as an array, and the compiler will convert things accordingly.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact