The reason for the main method, which has void as the return type, is that after main completes, this does not necessarily mean that the entire program is complete. If main spawns new threads, then these threads can support the program. The return type main does not make sense at this point.
For example, this is very common in Swing applications, where the main method usually starts the GUI in the Swing thread, and then main ends ... but the program still works.
Peter Štibraný Feb 12 '09 at 8:56 2009-02-12 08:56
source share