Java HttpCookie domainMatches() MethodThe domainMatches(String domain, String host)method of HttpCookie class is used to check whether a host name lies in a domain or not. SyntaxParameterThe above method requires two parameters:
ReturnThe above method is used to return true if the domain matches. Otherwise, returns false. Example 1Test it NowOutput: Tests whether a host name lies in the domain or not: false Example 2Test it NowOutput: Tests whether a host name lies in the domain or not: true Example 3Test it NowOutput: Tests whether the first host name lies in the first domain or not: true Tests whether the second host name lies in the second domain or not: false Next Topicequals() 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