Javatpoint Logo
Javatpoint Logo

Java URL equals() Method

The equals() method of URL class compares this URL for equality with another URL object. It returns false if the given object is not a URL. If IP address of two different is same, then it considered equivalent host.

Syntax

Overrides

equals in class Object

Parameter

obj - the URL to compare against.

Returns

true if the objects are the same; false otherwise.

Example 1

Test it Now

Output:

Matching url : true
Next TopicJava URL Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA