Javatpoint Logo
Javatpoint Logo

Java Method equals() Method

The equals () method of Method class compares this method against the specified object and returns true if both are same.

Syntax

Parameter

obj - the reference object with which to compare.

Returns

true if these objects are same; false otherwise.

Throw

No exception is thrown.

Example 1

Test it Now

Output:

Methods are not equal.

Example 2

Test it Now

Output:

First Method object from array :::::public java.lang.String DemoClassNo1.adddata(java.lang.String)
Method object created by :::::public java.lang.String DemoClassNo1.adddata(java.lang.String)
Both Method objects  are equal
Next TopicJava Method 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