Javatpoint Logo
Javatpoint Logo

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
Next TopicgetDomain() Method





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA