I've read this paragraph in a textbook introducing servlets:
A servlet is loaded by the servlet container the first time the servlet is requested. The servlet then is forwarded the user request, processes it, and returns the response to the servlet container, which in turn sends the response back to the user. After that, the servlet stays in memory waiting for other requests-it will not be unloaded from the memory unless the servlet container sees a shortage of memory. Each time the servlet is requested, however, the servlet container compares the timestamp of the loaded servlet with the servlet class file. If the class file timestamp is more recent, the servlet is reloaded into memory. This way, you don't need to restart the servlet container every time you update your servlet.
I can't get the statement in bold. What is that timestamp being compared and why would the timestamp of the loaded servlet differ than that of the servlet class file?
it is possible to update the .class file in a running deployed application instance, such as from uploading a new .war file (but that usually triggers a context reload anyway).
the web applicatation container's class loader would have custom logic to inspect the file system's copy of the .class file to read its modified timestamp and compare to its own last loaded time.