相关疑难解决方法(0)

从实现类中获取接口名称

示例:

List<String> list = new ArrayList<String>();
//This would give me the class name for the list reference variable.
list.getClass().getSimpleName();
Run Code Online (Sandbox Code Playgroud)

我想从list引用变量中获取接口名称.有什么办法可以吗?

java interface class

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

class ×1

interface ×1

java ×1