why dispose method is not for string object in c#? As we know Dispose() is the method for dispose the object. But why it is not allows for string object or integer object?
Edited: What does the mean of managed object ?. Please guide me.
No, Dispose is the method to dispose resources not managed by the GC. String is just a regular, managed object and will thus be automatically reclaimed by garbage collection.
Dispose is to release all external resources, string and int are simple data types and have no external resources.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With