Java Method equals() MethodThe equals () method of Method class compares this method against the specified object and returns true if both are same. SyntaxParameterobj - the reference object with which to compare. Returnstrue if these objects are same; false otherwise. ThrowNo exception is thrown. Example 1Test it NowOutput: Methods are not equal. Example 2Test it NowOutput: 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
|