Home >Java >javaTutorial >How to get the name of the current method in Java?

How to get the name of the current method in Java?

王林
王林forward
2023-04-21 18:19:081439browse

Get the name of the current method

<span style=
"font-family:Arial;font-size:14px;"
>String methodName = Thread.currentThread().getStackTrace()[
1
].getMethodName(); </span>

The above is the detailed content of How to get the name of the current method in Java?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete