In ruby it would look like
myfunction (["element1", "element2", "element3"],"other argument")
Can I do the same in java? One line only.
I know I can use
开发者_高级运维 String[] dataToPass = new String[3];
dataToPass[0] = "element1";
dataToPass[1] = "element2";
dataToPass[2] = "element3";
myfunction(dataToPass,"other argument");
myfunction(new String[]{"e1", "e2", "e3"},"other argument");
精彩评论