Online Java Compiler By
JavaTpoint.com
import java.net.HttpCookie; public class JavaHttpCookieGetNameExample3 { public static void main(String[] args) { HttpCookie cookie = new HttpCookie(" ", "4"); System.out.println("The name of the cookie is given as: "+ cookie.getName()); } }
Output