开发者

Var-arg syntax in Java

private void setUuid开发者_如何学C(int.. uuid)  
{
  // method stuff
}  

The Java 6 compiler complains when I try to use the syntax above .. Isn't the var-arg above valid ?


According to the 1.5 language docs it's three periods:

private void setUuid(int... uuid)  
{
  // method stuff
}


You need three dots to make an argument a vararg.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜