How do I get a list of Methods called from a Class in Eclipse IDE?

前端 未结 7 1671
眼角桃花
眼角桃花 2021-01-23 04:38

I am using Eclipse IDE for my Java project. I need a list of methods which are being called from a particular class i.e. I need to see a list of all the methods which are being

7条回答
  •  清歌不尽
    2021-01-23 04:58

    If you need to list only the method being used, there is no in-language way to achieve that. Though there might be some coverage tools which can handle this.

    But If its about all the available methods, you can use reflection:

        Class cls = Class.forName("className");
        Method[] methodList = cls.getMethods();
    

提交回复
热议问题