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 / purushottam kumar, mcad, mcsd

Finalize :
1.Finalize() is called by the runtime
2.Is a destructor, called by Garbage Collector when the
object goes out of scope.
3.Implement it when you have unmanaged resources in your
code, and want to make sure that these resources are freed
when the Garbage collection happens.

Dispose :
1.Dispose() is called by the user
2.Same purpose as finalize, to free unmanaged resources.
However, implement this when you are writing a custom class,
that will be used by other users.
3.Overriding Dispose() provides a way for the user code to
free the unmanaged objects in your custom class.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you turn off cookies on one page of your website?

948


Explain the main function of url routing system in asp.net mvc? : asp.net mvc

1017


Who can consume WebAPI?

1018


What is the use of web.config and machine.config files?

1151


What is a web api? Which protocol is used in a web api?

1071


Who generates session id?

946


COM+ Used ________________ Isolation Level

1960


What is state management technique?

1031


Explain diff. Betn dataset and recordset?

1006


What is request and response in asp.net?

963


How do you initiate validation on the server manually? What are two situations when you might you want to do that?

1838


What are validator? How do you disable them?

1140


Which type if caching will be used if we want to cache the portion of a page instead of whole page?

921


How can you apply a theme to your asp.net application?

974


What's the use of response.output.write()?

1274