Java HttpCookie getComment() 方法

2025年3月22日 | 阅读1分钟

Java HttpCookie 类的 getComment() 方法用于返回描述 cookie 目的的注释。此外,如果 cookie 没有注释,该方法可能会返回 null。

语法

参数

不适用。

返回

上述方法用于返回包含注释的字符串。此外,如果不存在注释,该方法可能会返回 null。

示例 1

输出

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

示例 2

输出

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

示例 3

输出
Comment 1:A HeadMaster is superior than a teacher.
Comment 2: A teacher is always a trustworthy person.
下一个主题getCommentURL() 方法