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...

What is the Difference B/W Finalize() and Dispose() in .Net?

Answer Posted / sreeram pavan

Both are ways to destroy the object. By object i mean when
you have some unmanaged resources used in your class, you
have to make sure that you write the logic to destroy them
in the finalize() method. But this is the implicit way of
destroying the unmanaged resources, as finalize is called by
garbage collector when it find thats there is no reference
to this object from the stack.
There is an explicit way to destroy the unmanaged resources.
That is by implementing IDisposable interface. By
implementing this interface, ie you have to write the code
to destroy the resource in Dispose() method, you can call
the object to destroy itself when ever required in your code.

Is This Answer Correct ?    51 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between application state and session state in asp net?

1056


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

931


Which is faster viewdata or viewbag?

1001


Why is this service branded with windows livetm?

1078


What is http request and response?

1027


Explain how dot net compiled code will become platform independent?

983


Where is http session stored?

934


Why is it preferred to not use finalize for clean up?

995


What is dynamic web page with example?

967


How do we ensure view state has not tampered?

1023


What is the difference between custom web user control and a custom web server control?

971


What is Pre-Render event in ASP.NET?

1115


What is the viewstate in asp.net?

1041


What is server transfer?

901


How to change Master page in ASP.Net using code?

1077