Varargs:
public static void foo(String... string_array) { ... }
versus
单一阵列段:
public static void bar(String[] string_array) { ... }
Java 1.6似乎接受/反对如下:
String[] arr = {"abc", "def", "ghi"};
foo(arr); // accept
bar(arr); // accept
foo("abc", "def", "ghi"); // accept
bar("abc", "def", "ghi"); // reject
假设上述情况是真实的/正确性的,为什么并不总是使用弹性而不是单一阵列。 Seems to add aplica of callser flexiblity for free.
Can an expert share the internal JVM difference, if there is one?
感谢。