Hello everybody, anyone knows how to get all instances of a class; something like ArrayList.getInstances() and I get all the instances of class ArrayList. Thanx Bat
Yes, finalize is run by the garbage collector whenever an object has no more active references... actually, that brings up a good question... I added the finalize() in so that the reference in the hashmap would be removed, but I think the very fact that the object exists in the hashmap means that finalize will never be run because the hashmap will always contain an active reference... I guess I didn't think it through that well... So either all objects of this class never get garbage collected until the program is over, or you have to add a special method to remove the reference from the hashmap to get rid of all active references...