Any way to declare an array in-line?
Draemon is correct. You can also declare m
as taking varargs:
void m(String... strs) {
// strs is seen as a normal String[] inside the method
}
m("blah", "hey", "yo"); // no [] or {} needed; each string is a separate arg here
m(new String[]{"blah", "hey", "yo"});