Java HttpCookie equals() MethodThe equals(Object obj) method of HttpCookie class is invoked to test the equality of two HTTP cookies. The result is returned as true if the two cookies come from the same domain, having the same name and the same path. SyntaxParameterThe above method requires only one parameter:
ReturnThe above method is used to return true if the two HTTP cookies are equal. Otherwise, returns false. Example 1Test it NowOutput: Both cookies come from same path and same domain. Example 2Test it NowOutput: Cookies are different. Example 3Test it NowOutput: Checks the first and second cookies if they are equal: true Checks the third and fourth cookies if they are equal: false Next TopicgetComment() 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