Get the interface name from the implementation class

后端 未结 2 1709
醉梦人生
醉梦人生 2020-12-20 15:44

Example :

List list = new ArrayList();
//This would give me the class name for the list reference variable.
list.getClass().getSi         


        
2条回答
  •  猫巷女王i
    2020-12-20 16:17

    Class  aClass = ... //obtain Class object. 
    Class[] interfaces = aClass.getInterfaces();
    

提交回复
热议问题