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


If we not suppress finalize method in dispose what will happen?

Answers were Sorted based on User's Feedback



If we not suppress finalize method in dispose what will happen?..

Answer / answerme

If we do not suppress finalize method in dispose, the
finalise method will be called twice by the garbage
collector. Once the method that is called by the developer
and once when the GC runs for checking the object that are
out of scope. This hampers the performance and is heavy on
performance.

Is This Answer Correct ?    2 Yes 0 No

If we not suppress finalize method in dispose what will happen?..

Answer / seema dalal

Dispose methods can be called automatically, if client
forget to call it.
for this ,Call the Dispose method in Finalize method and in
Dispose method suppress the finalize
method using GC.SuppressFinalize. Below is the sample code
of the pattern. This is the
best way we do clean our unallocated resources and yes not
to forget we do not get the hit
of running the Garbage collector twice.

Public Class ClsTesting
Implements IDisposable
Public Overloads Sub Dispose()Implements IDisposable.Dispose
' write ytour clean up code here
GC.SuppressFinalize(Me)
End Sub

Protected Overrides Sub Finalize()
Dispose()
End Sub
End Class

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More Dot Net Framework Interview Questions

Features in .net framework 1.1 ?

1 Answers   Digital GlobalSoft,


What is the difference between renderaction and renderpartial?

0 Answers  


Can I add mvc testcases in visual studio express?

0 Answers  


How do you initiate a string without escaping each backslash ?

1 Answers  


how many ways for pass the parameters in the fuction in c#

4 Answers  


what is the diff b/w asp.net 2.0 & 3.5

2 Answers   Wipro,


Why should we go for entity framework?

0 Answers  


what is MetadData?. What is CTS? Type of Join in SQL Server? What is diffrence between Primary Key and Unique Key?

7 Answers   FutureSoft,


I have interview in accenture.I cleared 1st round in techniqual.I have interview with project lead.pls help me.

2 Answers   Accenture,


How does CAS work

1 Answers  


What is entity sql? : Entity framework

0 Answers  


Explain the difference between viewbag and viewdata in mvc?

0 Answers  


Categories