Multiple choice technology programming languages

What must be implemented by all Servlets?

  1. Servlet Interface

  2. servlet mapping

  3. Servlet Container

  4. None of the Above

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

All servlets must implement the javax.servlet.Servlet interface, either directly or by extending a class like GenericServlet or HttpServlet which already implements it. The Servlet interface defines the lifecycle methods (init, service, destroy) that all servlets must support.

AI explanation

Every Servlet class must implement the Servlet interface, either directly or indirectly through GenericServlet or HttpServlet. The interface defines the lifecycle methods (init, service, destroy) that the servlet container calls to manage the servlet. A servlet mapping and container are related infrastructure concepts, but they aren't something the servlet class itself implements.