This week's giveaway is in the Android forum. We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line! See this thread for details.

While preparing for an upcoming Coursera course (Introduction to Algorithms) I came across this statement in the text

For example, the main() static method in our programs has a void return type
because its purpose is to produce output. Technically, void methods do not
implement mathematical functions (and neither does Math.random(), which
takes no arguments but does produce a return value).
-- p. 24 Algorithms (4e), Sedgewick & Wayne

Bold mine.

The part in bold stumped me. Can someone walk me through that statement?

The strict interpretation of a function is that basically, you give it some input (like 90 degrees), and you get some new value out - like 1. For any given input, there is exactly one possible output.

Since a method of type void does not give you back a return value, it does not fit the definition of a mathematical function.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors