Multiple choice technology programming languages

Which of the following servlet methods can return null?

  1. getInitParameterNames()

  2. getInitParameter(String name)

  3. getServletName()

  4. getServletContext()

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

The getInitParameter(String name) method of a Servlet returns a String containing the value of the named initialization parameter, or null if the parameter does not exist. Other methods like getServletContext() do not return null.