This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff 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.
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