Multiple choice technology

. To get an object of PrintWriter, we use getWriter() method of class _____________

  1. HttpSession

  2. HttpServletResponse

  3. HttpServletRequest

  4. none

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

The HttpServletResponse interface provides the getWriter() method, which returns a PrintWriter object for sending character text data to the client. This is the standard way to write response content in servlets. HttpServletRequest (request) handles incoming data, HttpSession manages user sessions, and PrintWriter itself is the class returned, not the source of it. The leading period appears to be a typo but doesn't affect the question.