Multiple choice technology architecture

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 init(ServletConfig) method receives the ServletConfig object as a parameter. The getServletConfig() method returns this ServletConfig object, which contains initialization parameters and servlet configuration. getServletInfo() returns servlet information (author, version etc.), not the config object. getInitParameters() is not a standard method - parameters are accessed via getInitParameter() on the config object.