1

I've seen the syntax before and it's close to the form of

public void foo( Object object1, Object ... ){}

Does anyone know the exact syntax or have a link to further information?

Ethan
  • 227
  • 4
  • 7

4 Answers4

3

In Java it is called varargs.

public void foo(Object object, Object... objects) {
    // the 'objects' argument is an array here.
}
Jeremy
  • 21,745
  • 4
  • 64
  • 79
Costi Ciudatu
  • 35,138
  • 6
  • 55
  • 91
1

You almost had it,

public void foo( Object object1, Object... objects ){}
Johan Sjöberg
  • 46,019
  • 20
  • 127
  • 142
1

Maybe you are looking for this?

omermuhammed
  • 7,295
  • 4
  • 26
  • 40
0

Java "params" in method signature?

may be what you are looking for.

Community
  • 1
  • 1
Brandon Frohbieter
  • 16,827
  • 3
  • 36
  • 61