Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieGetPortlistExample2 { public static void main(String[] args) { HttpCookie cookie1 = new HttpCookie("Student1", "3"); HttpCookie cookie2 = new HttpCookie("Student1", "3"); cookie1.setPortlist("3980"); cookie2.setPortlist("3900"); System.out.println("The first port list is given as:"+ cookie1.getPortlist()); System.out.println("The second port list is given as:"+ cookie2.getPortlist()); } }
Output