Answer Posted / 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 |
Post New Answer View All Answers
In which order the constructor is called for an inherited class?
How many types of polymorphism are there?
Can int be null in c#?
What is static classes in c#?
How to add controls dynamically to the form using c#.net.
What are Memory foot print of an exe?
What happens if a static constructor throws an exception?
What is system predicate?
Why constructor is used in c#?
Are cao stateful in nature?
What is a virtual property. Give an example?
What are the types of class in c#?
How many types of interface are there in c#?
Explain Constructor and destructor?
Do unused Namespaces in c# affect run-time performance?