Difference between dispose and destructor?

Answers were Sorted based on User's Feedback



Difference between dispose and destructor?..

Answer / nitin

Unused unmanaged resources are removed by dispose method
and It is called manually

Destructor is used to released unused managed resources and
it is called automatically by the Garbase Collector

Is This Answer Correct ?    21 Yes 3 No

Difference between dispose and destructor?..

Answer / vimala

the dispose() method is used to remove the unused resources
from the memory.

whereas the destructor () method is used to deallocate the
allocated memory by the constructor() method.

Is This Answer Correct ?    6 Yes 1 No

Difference between dispose and destructor?..

Answer / penchal das

Dispose()is a method which is used to deallocate the unused
resources.

Destructor() is a method which is called when an object was
destroyed.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What is dynamic object in c#?

1 Answers  


How many types of constructors are there?

1 Answers  


How can you overload a method?

3 Answers  


How many bytes is an int?

1 Answers  


Does C# support multiple inheritance?

3 Answers   IBM, Siebel Systems, Visual Soft,


C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

3 Answers   Visual Soft,


Are there functions in c#?

1 Answers  


What is ENUM?

10 Answers   TCS, Wipro, YeshTech,


Why do we use constructors in c#?

1 Answers  


What is better C# or VB.NET?

1 Answers  


Why are there five tracing levels in System.Diagnostics.TraceSwitcher?

1 Answers  


Does C# supports multi-dimensional arrays ?

4 Answers   Microsoft,


Categories