Java Reflection Java Java API
java.lang.reflect.Method
public String getName()
Returns the name of the method represented by this Method object, as a String .
Method
String
package com.logicbig.example.method;import java.lang.reflect.Method;public class GetNameExample { public void execute() {} public static void main(String... args) throws NoSuchMethodException { Method m = GetNameExample.class.getDeclaredMethod("execute"); String name = m.getName(); System.out.println(name); }}
execute