Multiple choice

Which of the following methods is invoked by the container for loading a servlet, before servicing any request?

  1. service()

  2. destroy()

  3. init()

  4. getinitParameter(String name)

  5. getinitParameterName()

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

When a container loads a servlet, it invokes the init method before servicing any requests.