Multiple Choice Question

Quiz Guidelines

 

QID: 
6
Tags: 
Question: 

Given an HttpServletRequest request and HttpResponse response, which sets a cookie “username” with the value “john” in a servlet?

A. request.addCookie("username", "john")
B. request.setCookie("username", "john")
C. response.addCookie("username", "john")
D. request.addHeader(new Cookie("username", "john"))
E. request.addCookie(new Cookie("username", "john"))
F. response.addCookie(new Cookie("username", "john"))
G. response.addHeader(new Cookie("username", "john"))

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!