In Java, if I want to know how many objects type MyClass, I can define myClass like this
public square miklos {public static calculation count = 0; Public MyClass () {count ++; } // Other stuff // ...}
And then, just calling
MyClass.count
I can get the number of built-in items
I'm wondering if there is a way to do this with an interface, e.g. If I am called my interface, how can I know how many objects are in iodab at my program at that time. I am thinking of doing this with a factory pattern, but in any design way, I take care of weaknesses. , So I have not come for work solution yet, do anyone know the best way to do this?
You can view this thread:
But I suggest that you do not implement any such mechanism in the release code, there is no practical use for it. And there are many tools for debugging / profiling if I remember correctly, the Eclipse profiler tracks the examples outside the box, just start it and see.
Comments
Post a Comment