Multiple choice technology web technology

What are the ancillary methods of javax.servlet.Servlet interface?(Choose all that apply)

  1. init()

  2. service()

  3. getServletContext()

  4. getServletConfig()

  5. getServletInfo()

Reveal answer Fill a bubble to check yourself
D,E Correct answer
Explanation

The Servlet interface has 5 methods: lifecycle methods (init, service, destroy) and ancillary methods (getServletConfig, getServletInfo). The question asks for ancillary methods - those NOT part of the core lifecycle. getServletConfig() returns the servlet's configuration object, and getServletInfo() returns descriptive information about the servlet. These are considered ancillary/support methods. Options A and B are lifecycle methods. Option C (getServletContext) returns the context but is NOT a method of Servlet interface - it's a method of ServletConfig interface (accessed via getServletConfig().getServletContext()).