Java HttpCookie clone() 方法

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

Java HttpCookie 类的 clone() 方法用于创建并返回对象的副本。

语法

参数

不适用。

返回

上述方法用于返回给定 HTTP cookie 的克隆。

示例 1

输出

The clone of the given HttpCookie is given as: Employee="1"

示例 2

输出

The first clone of the given HttpCookie is given as: Employee1="1"
The second clone of the given HttpCookie is given as: Employee2="2"
The third clone of the given HttpCookie is given as: Employee3="3"