Java Method getName() MethodThe getName() method of Method class returns the name of the method represented by this Method object, as a String. SyntaxParameterNo parameter is passed. Returnsthe simple name of the underlying member ThrowsDoes not throw the exception. Example 1Test it NowOutput: Method: getSampleField Method: setSampleField Method: wait Method: wait Method: wait Method: equals Method: toString Method: hashCode Method: getClass Method: notify Method: notifyAll Example 2Test it NowOutput: Method name:: Test
Next TopicJava Method Class
|