Advanced Java Programming (3160707) MCQs

MCQs of Servlet API and Overview

Showing 51 to 57 out of 57 Questions
51.

________ object is used to invoke the next filter in the chain of filters.

(a)

FilterConfig

(b)

Filter

(c)

FilterChain

(d)

FilterAction

Answer:

Option (c)

52.

Which element declares a filter inside deployment descriptor ?

(a)

<filter-interface>

(b)

<filter-class>

(c)

<filter-definition>

(d)

<filter-config>

Answer:

Option (b)

53.

What is the return type of getCookies() method ?

(a)

Cookie[]

(b)

Cookie

(c)

HttpSession

(d)

Cookie[5]

Answer:

Option (a)

54.

Which method returns a string containing the unique session id?

(a)

getSessionId()

(b)

getUniqueId()

(c)

getUniqueSessionId()

(d)

getId()

Answer:

Option (a)

55.

Which method is used to delete a session?

(a)

invalidateSession()

(b)

invalidate()

(c)

deleteSession()

(d)

delete()

Answer:

Option (b)

56.

Which method is use for setting session time out ?

(a)

setMaxActiveInterval()

(b)

invalidate()

(c)

setInactiveInterval()

(d)

setMaxInactiveInterval()

Answer:

Option (d)

57.

Which Cookie is valid for multiple session ?

(a)

Non-persistent cookie

(b)

Multi-Cookie

(c)

Persistent cookie

(d)

none of the above

Answer:

Option (c)

Showing 51 to 57 out of 57 Questions