A servlet is loaded at startup, processes several requests, and then is removed from the server. Identify the correct order of method invocations in its lifecycle.

  • destroy() -> service() -> init()
  • init() -> destroy() -> service()
  • init() -> service() -> destroy()
  • service() -> init() -> destroy()
The correct order of method invocations in the lifecycle of a servlet is init() (initialization) -> service() (processing requests) -> destroy() (removal from the server).
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *