Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Describe ways of cleaning up objects.

Answer Posted / vaidyanathan

By Dispose() method the object is marked for garbage
collection. But user can define a Dispose() method
identified by GC, only when the user implements the
IDisposable interface in the class. Once the dispose()
marks the object for deletion, the garbage collector, in
its subsequent collection cycle, collects the objects by
calling the respective Finalize() methods. So there is no
need for the user to write the Finalize() method. This is
the normal Process of Garbage collection.

At extreme cases user can force the garbage collection at a
specific time by calling GC.Collect() method. This should
be followed by GC.SuppressFinalize() method call to avoid
GC from calling Finalize() method on the same object once
again.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you sort strings in array that are passed to method as arguments?

916


What is arraylist class in c#?

1016


Name some string escape sequences in c#.

990


what is IFormatable

928


What are the advantages of interface in c#?

889


Differentiate between static class and singleton instance?

953


What is difference between iqueryable and ienumerable in c#?

823


Can we extend static class in c#?

857


Why data types are important in c#?

877


If I want to override a method one of class A and in class b then how do you declare?

1216


What are accessors?

945


What is the usage of transponders?

882


What is int64 in c#?

842


What is the .net datatype that allows the retrieval of data by a unique key?

846


The int maps to which C# keyword in .NET type?

982