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 |
What are the types of serialization?
How do you comment out code in c#?
What is multithreading? What are the problems that comes with multithreading and how to manage them?
What are the fundamental oop concepts?
What is the difference between protected and private?
What is a statement c#?
How jit (just in time) works?
What is marshalling and what are different kinds of marshalling?
Are enums static c#?
What are the different states of a thread?
What is different between Implicit conversion and Explicit conversion in C#?
What is the boxing and unboxing in c#?