I have entered the below code (which is from the answers) in Eclipse and it's giving me this error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
It's called a command line argument; I haven't tried that code, so I don't know what would happen if you passed something other then “yes”. The nearest code I can find to that is on HFJ page 328, but it isn't exactly the same.
[addition]I now see it says code magnets; that would appear to be page 349.
She'll be back. I'm just gonna wait here. With this tiny ad: