How we free the memory in C#.NET.
Answers were Sorted based on User's Feedback
Answer / prashanth s
Actually the freeing of the memory is done by the CLR
automatically by calling the garbage collection routine.
But the declared objects by the user can be deallocated
manually by using dispose function in the class by
implementing IDisposable interface in the object class.
Otherwise it can also be done by implementing a destructor
in the class, as the destructor defined will help
deallocating the object allocation after the usage of the
object gets over, i.e the object is not used anywhere else
in the program.
Is This Answer Correct ? | 15 Yes | 0 No |
Answer / mayur teli
We can also use Using statement
when we use it, there is no need to explicitly dispose the object. Using statement take care of it.
Is This Answer Correct ? | 3 Yes | 1 No |
How to create multi-dimensional array?
What is yield c#?
What is datasource c#?
Can you mark static constructor with access modifiers?
What is strong name in c# and how can we use it?
How to find methods of a assembly file (not using ILDASM)?
Explain the difference between abstract class and interface.
Can dictionary have duplicate keys c#?
What is the xml document structure?
How to raise an selection changed event associated with listbox in datagridview control with a sample example?Here the listbox is a child control associated with datagridview control.
How?s method overriding different from overloading?
Is it possible to add two 50 digit numbers in .net? If yes what is the code snippet?
2 Answers Cognizant, W3 Solutions, Zefer,