New answers tagged methods
values is an array of String. I'm not sure what observation led you to conclude otherwise. Variadic method parameters in Java collect the arguments into an array, as you can see in the Java 5 varargs documentation. To find out the type of an object, use values.getClass().getName() (yields "[Ljava.lang.String;" indicating an array of String). You can use ...
This is a varargs argument, and values is treated as a String array. Java is hiding the array creation, note., but you can call that method with an array rather than just a list of arguments.
Top 50 recent answers are included