Given that-
public class Demo{
public void Find(){
Example.A();
String str = new Example().B();
}
}
I want to find out the name of all the methods that are called inside the Find()
method in the Demo
class and store it in an ArrayList
(Method A()
and Method B()
in this case). How do I achieve that?
Example
is another class in the same package with two methods: A static method A()
and non-static method B()
which returns a String
.