Question: > 
> **Possible Duplicates:**  
> 
> [What does “…” mean in Java?](https://stackoverflow.com/questions/4618930/what-does-mean-in-java)  
> 
> [Java array argument “declaration” syntax](https://stackoverflow.com/questions/4211099/java-array-argument-declaration-syntax) 
> 
> 
> 

Can anyone confirm if I'm right in seeing the `Object...` parameter in the method call below:

```
public static void setValues(PreparedStatement preparedStatement, Object... values)
    throws SQLException
{
    for (int i = 0; i < values.length; i++) {
        preparedStatement.setObject(i + 1, values[i]);
    }
}    

```

As an array of type Object? I don't recall seeing `...` before in Java.

Answer: 
From the Java Tutorial ([Passing Information to a Method or Constructor](http://download.oracle.com/javase/tutorial/java/javaOO/arguments.html)):

> 
> **Arbitrary Number of Arguments**
> 
> 
> You can use a construct called varargs
>  to pass an arbitrary number of values
>  to a method. You use varargs when you
>  don't know how many of a particular
>  type of argument will be passed to the
>  method. It's a shortcut to creating an
>  array manually (the previous method
>  could have used varargs rather than an
>  array). To use varargs, you follow the
>  type of the last parameter by an
>  ellipsis (three dots, ...), then a
>  space, and the parameter name. The
>  method can then be called with any
>  number of that parameter, including
>  none.
> 
> 
> 

```
public Polygon polygonFrom(Point... corners) {
    int numberOfSides = corners.length;
    double squareOfSide1, lengthOfSide1;
    squareOfSide1 = (corners[1].x - corners[0].x)*(corners[1].x - corners[0].x) 
            + (corners[1].y - corners[0].y)*(corners[1].y - corners[0].y) ;
    lengthOfSide1 = Math.sqrt(squareOfSide1);
    // more method body code follows that creates 
    // and returns a polygon connecting the Points
}

```

> 
> You can see
>  that, inside the method, corners is
>  treated like an array. The method can
>  be called **either with an array or with
>  a sequence of arguments**. The code in
>  the method body will treat the
>  parameter **as an array in either case.**
> 
> 
>
What you are looking at is a varargs parameter. The documentation on it can be found [here](http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html).

Varargs are equivalent to an object array, but there is syntactic sugar to make calling that method easier. So the old way was (this code is from the document above):

```
Object[] arguments = {
    new Integer(7),
    new Date(),
    "a disturbance in the Force"
};

String result = MessageFormat.format(
    "At {1,time} on {1,date}, there was {2} on planet "
     + "{0,number,integer}.", arguments);

```

With varargs you get to write:

```
String result = MessageFormat.format(
    "At {1,time} on {1,date}, there was {2} on planet "
     + "{0,number,integer}.", 7, new Date(), "a disturbance in the Force");

```

Note that autoboxing helps here to convert the int 7 to `new Integer(7)` without you having to explicitly declare it.