Multiple choice technology

In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?

  1. getServletInfo()

  2. getInitParameters()

  3. getServletConfig()

  4. none

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

The getServletConfig() method returns the ServletConfig object passed to the servlet's init() method. This allows access to initialization parameters and servlet context throughout the servlet's lifecycle.