In the 应用引擎文档 http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/xmpp/MessageBuilder.html,省略号是什么(JID...
)在这个方法签名中?
public MessageBuilder withRecipientJids(JID... recipientJids)
这三个点的作用是什么?
这些是 Java 可变参数。它们允许您传递任意数量的特定类型的对象(在本例中它们是 JID 类型)。
在您的示例中,以下函数调用将是有效的:
MessageBuilder msgBuilder; //There should probably be a call to a constructor here ;)
MessageBuilder msgBuilder2;
msgBuilder.withRecipientJids(jid1, jid2);
msgBuilder2.withRecipientJids(jid1, jid2, jid78_a, someOtherJid);
在这里查看更多内容:http://java.sun.com/j2se/1.5.0/docs/guide/language/varargs.html http://java.sun.com/j2se/1.5.0/docs/guide/language/varargs.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)