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 Types of assemblies that can be created in dotnet
Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio ?
What is a partial class. Give an example?
What is check/uncheck?
Is string nullable in c#?
Define assert() method? How does it work?
Does c# do array bounds checking?
What is Interface and Abstraction (in real time scenario)
What is anonymous types in c#?
What is difference between hashtable and dictionary in c#?
Define parsing? Explain how to parse a datetime string?
Which attribute is used in order that the method can be used as webservice?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)