I've seen the syntax before and it's close to the form of
public void foo( Obj开发者_JAVA技巧ect object1, Object ... ){}
Does anyone know the exact syntax or have a link to further information?
In Java it is called varargs.
public void foo(Object object, Object... objects) {
// the 'objects' argument is an array here.
}
You almost had it,
public void foo( Object object1, Object... objects ){}
Maybe you are looking for this?
Java "params" in method signature?
may be what you are looking for.
精彩评论