Java
T
point
Home
Python
Java
JavaScript
HTML
SQL
PHP
C#
C++
DS
Aptitude
Reasoning
Selenium
DBMS
C
Android
Interview Q
Content Menu ▼
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Question 1
:
Given an HttpServletRequest request and HttpServletResponse response, which sets
a cookie "username" with the value "joe" in a servlet?
1.
request.addCookie("username", "joe")
2.
request.setCookie("username", "joe")
3.
request.addHeader(new Cookie("username", "joe"))
4.
response.addCookie(new Cookie("username", "joe"))