Multiple choice technology web technology

Servlet Lifecycle

  1. init(),getServletInfo(),destroy(),service(),getServletConfig()

  2. init(),getServletConfig(),service(),getServletInfo(),destroy()

  3. init(),destroy(),getServletInfo(),getServletConfig(),destroy()

  4. destroy(),service(),init(),getServletConfig(),getServletInfo()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The servlet lifecycle methods in order are: init() (called once when servlet is first loaded), service() (called for each request), and destroy() (called once before servlet is unloaded). getServletConfig() retrieves configuration and is available after init(), while getServletInfo() returns servlet information. Option B correctly sequences the core lifecycle: init, then service, then destroy.