think about we have a private hashtable object (variable)
we initialize the objects in some methods, now we create a cleanup
method, we can either new
1) hash = new HashTable();
or
2) hash.Clear();
is there any difference? on speed and resource allocation
I think for HashTable may be no different; what about a Disposable
object?
Will the first way creates garbage if we don't dispose the existed
object?
Thanks
we initialize the objects in some methods, now we create a cleanup
method, we can either new
1) hash = new HashTable();
or
2) hash.Clear();
is there any difference? on speed and resource allocation
I think for HashTable may be no different; what about a Disposable
object?
Will the first way creates garbage if we don't dispose the existed
object?
Thanks