Is there a way to find out how many times an instance of a class called its member method.
I think (not sure), one way is to have a dedicated member variable for the method, but that will not be possible if we have so many methods.
For instance:
class A{
public void someMethod(){
}
}
and I have an example:
A a = new A();
So, I want to know how many times I acalled someMethodin the program. We can have any number of methods.
source
share