>>> "David S. Soleno" <[EMAIL PROTECTED]> 4/10/99 8:40:51 PM >>>
>I was under
>the impression sevlets didn't have a constructor, so what is the
call to
>'new' instantiating?
Everything in Java has a constructor. By default the constructor does
nothing, so you don't need to specify it (all objects, in effect,
inherit the constructor from Object()).
>Regardless of the servlet constructor question I recommended that he
change
>the code to
>myThread = new Thread( this );
>myThread.start();
You're right. But it depends. Why is he creating a new Thread?
If it is because the run() method of the servlet implementing
Runnable is actually doing some special processing it would be better
design to write annother class to implement Runnable and instantiate
that. Personally, even if the code was insignificant I would create an
inner class to implement Runnable and instantiate it the way he is
doing with new().
But you're still right. He doesn't really need to instantiate a new
copy.
Nic Ferrier
Tapsell-Ferrier Ltd
www.tapsellferrier.co.uk
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html