省略号(…)是什么?在这个方法中签名?在APP引擎文档,省略号是什么?JID...)在这个方法中签名?public MessageBuilder withRecipientJids(JID... recipientJids)这三个点的作用是什么?
3 回答
潇湘沐
TA贡献1816条经验 获得超6个赞
public void PrintWithEllipsis(String...setOfStrings) { for (String s : setOfStrings) System.out.println(s);}
obj.PrintWithEllipsis(); // prints nothingobj.PrintWithEllipsis("first"); // prints "first"obj.PrintWithEllipsis("first", "second"); // prints "first\nsecond"
PrintWithEllipsis
setOfStrings
String[] argsVar = {"first", "second"};obj.PrintWithEllipsis(argsVar);
void process(String[] s){}void process(String...s){}
variable arity parameter
varargs
.
添加回答
举报
0/150
提交
取消