I have the following code
String[] args = {"a", "b", "c"};
method(args);
private void method(String[] args){
return args;
}
Why can I not do the following without errors?
method({"a", "b", "c"});
This code is example just to prove the point, not the actual methods I am using. I would like to do the second method instead to clean up my code, and avoid declaring a dozen different arrays when I only use them once to pass to my method.
The heart of the question is what is the most efficient way to pass an array of strings as a method paramter.