flight404 wrote on Apr 28th, 2005, 5:45am:void is a method that returns no result.
[...]
With void, nothing gets returned. So when you say void draw(), it does the stuff in the draw method, but isnt concerned with returning any variables.
And by using "void" you're telling the compiler that "void" (or "nothing will be returned") is correct, which is important for the compiler and error-checking in a typed language such as Java.
Chuck Liang, Hofstra University Computer Science, gives an example:
"In any typed language, you cannot have expressions such as
if (A) return "abc"; else return 2;
although such expressions are legal (and sometimes useful) in untyped languages such as Scheme and Perl. The down side of the flexibility of these languages is that it becomes impossible for the compiler to detect type errors before runtime."
Why "void" I suppose that for an object-oriented language, the opposite of an object is a void.
-K