How do I create a method that accepts a variable number of arguments?

John Zukowski

Variable arity or vararg methods were added to JDK 5.0. The last argument to a method can be declared as Type... name, where Type is the Java class type for the argument, and name is how it is accessed.

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

 

 

 

 

 


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

 

 

About | Sitemap | Contact