 Let's look at this program that uses printf. There's something interesting here. The first call has two arguments, the second call has three arguments, and the last call has four arguments. But in all the methods we've written so far, we've had to specify exactly how many arguments a method can have. What strange sorcery is this that allows you to give printf as many arguments as you'd like? The answer is that Java lets you specify that a method can have a variable number of arguments. We're going to write a method that returns the maximum of any number of arguments so that we can write a program like this, printing the maximum of two integers, the maximum of three integers, or the maximum of a whole group of integers. Here's the method header. It's going to return an int. We'll call it max, and the parameter will be int dot dot dot numbers. The three dots tell Java to expect a variable number of arguments and to treat them as if they were an array. The body of the method looks like this. We'll set our maximum value to be the first argument, which is the first element of the argument array in this case, and then we'll iterate through the remaining numbers if one of the arguments is greater than the current maximum. It becomes a current maximum. When we're out of the loop, we'll return that maximum. Let's compile that, and let's run it, and it works. Because the variable arguments are treated as an array, you can also pass an array to this method. I can create an integer array called data, which has some numbers in it, and then I can use the array as an argument. Compile and run, and that works too. There are two restrictions on using variable arguments. You can't have more than one variable arguments parameter, and the variable arguments parameter must be the last one in the parameter list.