Javatpoint Logo
Javatpoint Logo

Java Method getName() Method

The getName() method of Method class returns the name of the method represented by this Method object, as a String.

Syntax

Parameter

No parameter is passed.

Returns

the simple name of the underlying member

Throws

Does not throw the exception.

Example 1

Test it Now

Output:

Method: getSampleField
Method: setSampleField
Method: wait
Method: wait
Method: wait
Method: equals
Method: toString
Method: hashCode
Method: getClass
Method: notify
Method: notifyAll

Example 2

Test it Now

Output:

Method name:: Test
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