原文:获取当前的方法名字,运用线程类Thread

得到当前方法的名字StringmethodName Thread.currentThread .getStackTrace .getMethodName getStackTrace 返回一个表示该线程堆栈转储的堆栈跟踪元素数组。如果该线程尚未启动或已经终止,则该方法将返回一个零长度数组。如果返回的数组不是零长度的,则其第一个元素代表堆栈顶,它是该序列中最新的方法调用。最后一个元素代表堆栈底,是该 ...

2019-10-12 09:42 0 747 推荐指数:

查看详情

java获取当前名和方法名

Description Below I present you two different ways to get the current Class: Using Thread Using getClass() The simplest way to get ...

Mon Jan 08 19:10:00 CST 2018 0 18234
Java获取当前名和方法名

获取class名: this.getClass().getName(); 或者 Thread.currentThread().getStackTrace()[1].getClassName(); 获取方法名: Thread.currentThread().getStackTrace ...

Thu Jan 02 21:53:00 CST 2020 0 6876
PHP获取当前名、函数名、方法名

PHP获取当前名、方法名 __CLASS__ 获取当前名 __FUNCTION__ 当前函数名(confirm) __METHOD__ 当前方法名 (bankcard::confirm) __FUNCTION__ 函数名称(PHP 4.3.0 新加)。自 PHP ...

Fri Jan 17 09:19:00 CST 2014 0 72614
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM