Java HttpCookie clone() Method

The clone() method of Java HttpCookie class is invoked to create and return a copy of the object.

Syntax

Parameter

N.A.

Return

The above method is used to return a clone of the given HTTP cookie.

Example 1

Test it Now

Output:

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

Example 2

Test it Now

Output:

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"




Latest Courses