Why have the header 'public static void main(String[] args)' at all?  
Author Message
Chris Smith





PostPosted: 2004-9-8 1:15:00 Top

java-programmer, Why have the header 'public static void main(String[] args)' at all? Stewart Gordon wrote:
> jAnO! wrote:
> > How's that?
> > I thought that your main thread maintains a !dead state troughout the
> > runtime of your application.
>
> We're talking about the method called main, not the main thread.

Even so, both the main method and the main thread exit directly toward
the beginning of a typical GUI application. What may *not* end, on some
operating systems, is the native OS-level thread that is used to
implement Java's concept of the main thread.

It's undefined whether that OS-level thread lives or not following the
termination of Java's main thread. It must on many platforms in order
to get around POSIX and other similar thread conventions (including
Win32, IIRC) that designate it as a special thread. On a system that
implemented a very different threading convention, though, which didn't
carry POSIX and Win32's pre-multithreading baggage, it would probably
not be necessary.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation