when you need this only for evaluating answers for the GC questions, why don't you just modify the classes with a constructor, that count++es a static int variable for creation and an override of the finalize() method that count++es a static int variable for garbage collection? Perhaps both with a system out of a line of information?
Just a proposal, Bu.
all events occur in real time
Where does a nanny get ground to air missles? Protect this tiny ad: