Java get current method
•
Java
1. Get the current method stack. We usually use
StackTraceElement[] stes = Thread. currentThread(). getStackTrace();
To get the current method, remember that it is not flexible enough. Use the fixed index of array Stes (many on the Internet say so, please distinguish it clearly).
Let's see what the API says?
getStackTrace
public [] getStackTrace()
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码