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?

Set of Theseus
  • 357
  • 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
  • 22,188
  • 4
  • 68
  • 81
Costi Ciudatu
  • 37,042
  • 7
  • 56
  • 92
1

You almost had it,

public void foo( Object object1, Object... objects ){}
Johan Sjöberg
  • 47,929
  • 21
  • 130
  • 148
1

Maybe you are looking for this?

omermuhammed
  • 7,365
  • 4
  • 27
  • 40
0

Java "params" in method signature?

may be what you are looking for.

Community
  • 1
  • 1
Brandon Frohbieter
  • 17,563
  • 3
  • 40
  • 62