Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieSetCommentURLExample2 { public static void main(String[] args) { HttpCookie cookie1 = new HttpCookie("Employee1", "151"); HttpCookie cookie2 = new HttpCookie("Employee2", "152"); cookie1.setCommentURL("345.187.90."); cookie2.setCommentURL("452.121.29.7"); // Specifies a comment URL which describes the purpose of the cookie System.out.println("The first comment URL is given as : "+cookie1.getCommentURL()); System.out.println("The second comment URL is given as : "+cookie2.getCommentURL()); } }
Output