This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Note that x is a varargs parameter. Inside the method it will look like an array (an int, to be precise). When you call the method without any arguments, x will be an array of length 0. The method will then do nothing, because there's nothing to loop over.
I don't know if you come from a C++ background or not. In that language, you CAN set a default value for a parameter.
However, Java is not C.
The compiler considers this to be legal because it knows that the only time this method runs is when it's called by some other method - which must provide a value. the way the language is designed, if they do call it with "foo()", Java will supply an empty array - which is still something.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors