The reason the code will not work without void
is because the System.out.println(String string)
method returns nothing and just prints the supplied arguments to the standard out terminal, which is the computer monitor in most cases. When a method returns "nothing" you have to specify that by putting the void
keyword in its signature.
You can see the documentation of the System.out.println here:
http://download.oracle.com/javase/6/docs/api/java/io/PrintStream.html#println%28java.lang.String%29
To press the issue further, println is a classic example of a method which is performing computation as a "side effect."