What is the result of running the following as java MyClass?
public class MyClass { public static void main(String... original) { String... copy = original; System.out.println(copy.length + " " + copy[0]); } }
D.
Three dots in a row is a varargs
parameter.
While varargs
is used like an array from within the method, it can only be used as a method parameter.
This syntax is not allowed for a variable, making Option D the answer.