What does "String ..." mean?
In code:
public interface ProductInterface { public List<ProductVO> getProductPricing(ProductVO product, ProductVO prodPackage, String... pricingTypes) throws ServiceException; } What is he doing
String... pricingTypes mean? What type of construction is this?
It is called varargs . It works for any type if it is the last argument in the signature.
In principle, any number of parameters is placed in an array. This does not mean that it is equivalent to an array.
A method that looks like this:
void foo(int bar, Socket baz...) will have a Socket array (in this example) called baz.
So, if we call foo(32, sSock.accept(), new Socket()) , we will find an array with two Socket objects.
A call to foo(32, mySocketArray) will not work, because the type is not configured to receive an array. However, if the signature is varargs of arrays, you can pass one or more arrays and get a two-dimensional array. For example, void bar(int bar, PrintStream[] baz...) can take several PrintStream arrays and insert them into one PrintStream[][] .
Oddly enough, due to the fact that arrays are objects, Object... foo can accept any number of arrays.
This argument is vararg - variable. You can pass a value of this type as many times as you want, and the caller receives it as an array.
http://docs.oracle.com/javase/7/docs/technotes/guides/language/varargs.html