Q:

How HttpServlet can create threads without implementing Runnable or extending thread

As we know, when servlet receivies a request, it creates a new thread and inside the new thread, the service method is invoked. So with only one Servlet instance, many threads are invoked.
What I didn't understand is how HttpServlet is able to create threads of its own instance without implementing runnable or extending thread?
Can any one please clarify.

A:

As we know, when servlet receivies a request, it creates a new thread and inside the new thread, the service method is invoked. So with only one Servlet instance, many threads are invoked.

In fact, that is INCORRECT.  The web container typically maintains a bounded pool of worker threads to handle requests.  New threads don't get created for each new request.

What I didn't understand is how HttpServlet is able to create threads of its own instance without implementing runnable or extending thread?

Basically, it doesn't.  HttpServlet does not create threads, and it is not a thread or a runnable.
The web container has implementation specific classes that implement Runnable or extends Thread.  These classes call the relevant methods on the (shared) Servlet instance.

