Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieCloneExample2 { public static void main(String[] args) { HttpCookie cookie1 = new HttpCookie("Employee1", "1"); HttpCookie cookie2 = new HttpCookie("Employee2", "2"); HttpCookie cookie3 = new HttpCookie("Employee3", "3"); //Return a clone of the given HTTP cookie. System.out.println("The first clone of the given HttpCookie is given as: "+cookie1.clone()); System.out.println("The second clone of the given HttpCookie is given as: "+cookie2.clone()); System.out.println("The third clone of the given HttpCookie is given as: "+cookie3.clone()); }
Output