Why is the dispose method not for a string object?

why isn't the dispose method for a string object in C #? As you know, Dispose () is a method for deleting an object. But why does this not allow the use of a string object or an integer object?

Edited : what does a managed entity mean? Please guide me.

+3
source share
4 answers

No, Dispose is a method of disposing of resources that are not managed by the GC. A string is just a regular, managed object and thus will be automatically fixed by garbage collection.

+9
source

Dispose - release all external resources, string and int are simple data types and do not have external resources.

+2
source

- , , , . , . , , .

, ( ) . " ". : . .

Dispose - . using .

, .

0

Dispose is also needed for objects that place hooks on other objects (for example, event handlers). If, for example, an object subscribes to change notifications for another object, it must inform that other object when it will no longer send such notifications.

0
source

Source: https://habr.com/ru/post/1762406/


All Articles