Java HttpCookie getName() MethodThe getName() method of Java HttpCookie class is invoked to return the name of the cookie. Once, the cookie is created, the name of the cookie cannot be altered. SyntaxParameterN.A. ReturnThe above method is used to return a String which specifies the name of the cookie. Example 1Test it NowOutput: The name of the cookie is given as: Student Example 2Test it NowOutput: The name of the first cookie is given as: Student1 The name of the second cookie is given as: Student2 Example 3Test it NowOutput: Exception in thread "main" java.lang.IllegalArgumentException: Illegal cookie name at java.net.HttpCookie. Next TopicgetPath() Method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India