Java HttpCookie getDiscard() Method

The getDiscard() method of HttpCookie class is used to return the discard attribute of the cookie.

Syntax

Parameter

N.A.

Return

The above method is used to return a Boolean which represents the cookie?s discard attribute.

Example 1

Test it Now

Output:

Checks the discard attribute of the cookie : false

Example 2

Test it Now

Output:

Checks the discard attribute of the cookie: true




Latest Courses