Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieGetCommentExample3 { public static void main(String[] args) { HttpCookie object1 = new HttpCookie("HeadMaster", "8"); HttpCookie object2 = new HttpCookie("Teacher", "9"); object1.setComment("A HeadMaster is superior than a teacher."); System.out.println("Comment 1:"+ object1.getComment()); object2.setComment("A teacher is always a trustworthy person."); System.out.println("Comment 2: "+object2.getComment()); } }
Output