Java HttpCookie getComment() Method

The getComment() method of Java HttpCookie class is used to return the comment which describes the purpose of the cookie. Also, the method may return null if the cookie has no comment.

Syntax

Parameter

N.A.

Return

The above method is used to return a string containing the comment. Also, the method may return null if there is no comment.

Example 1

Test it Now

Output:

Comment:Worker works in a factory on daily basis pay.

Example 2

Test it Now

Output:

Comment:Mangaer manages all the records of the factory in a sequential order.

Example 3

Test it Now

Output:

Comment 1:A HeadMaster is superior than a teacher.
Comment 2: A teacher is always a trustworthy person.




Latest Courses