Atulya Panda
What is the use of the dispose method in C# ?
By Atulya Panda in C# on Nov 26 2012
  • Sindhu Nagarajan
    Feb, 2021 22

    Methods dispose() method of C# which are invoked to free the unmanaged resources held by an object.

    dispose( ) is used to free unmanaged resources whenever it is invoked. It is invoked by the user.
    Refer,
    https://techdifferences.com/difference-between-dispose-and-finalize-in-c-sharp.html

    • 1
  • Sandeep Kumar
    Sep, 2015 28

    Dispose method use to remove the object from memory ,which object has no references or those object are unreachable.dispose method get call by user.

    • 1
  • Tanuj Khurana
    Sep, 2015 18

    this is basically used for forcefully garbage collection. if i do not write dispose then its its job is for compiler to do this. but it do not give you surety that it freeze the memory immediately. if i want to force compiler to ask free memory immediately then we use dispose method. it internally calls finalize method.

    • 1
  • shekhar kumar
    Apr, 2013 1

    dispose method are used for forcefully garbage collection..!!!

    • 1
  • shekhar tyagi
    Jul, 2013 8

    dispose method are used for forcefully garbage collection to relase Unmannaged code

    • 0
  • Shankar M
    Feb, 2013 18

    Freeing of resources.. Best Practice is to use the Keyword using which automatically frees the resources that are no longer needed.

    • 0
  • Neena M
    Dec, 2012 10

    dispose is used to relase the resources when they are no longer required.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS