Getting Started with Adobe After Effects - Part 6: Motion Blur
This module helps you to share, discuss and learn interview questions and answers of different technologies

ASP.NET - Implmenting Custom interface with a dispose() method will be considered by GC for garbage collection?

Jan 10 2012 2:02AM by Ramireddy   

Question

Recently i received this interesting question, suppose, if i implement an Custom interface with a dispose() method, will Garbage Collector detect?

Answer

No. Garbage Collector will not detect custom interface. We should implement IDisposable interface and needs to implement dispose() method. Then only Garbage Collector consider the object for cleaning memory.

Internally GC could have performed this check for only types which implemented interface "IDisposable". Another reason behind this is, implementing such kind of patterns will leads to another problems, like suppose, a developer unknowingly keep the method name as "Dispose" itself. So, to avoid these problems, GC will check for types which implements the interface "IDisposable" only

Read More..   [32134 clicks]

Published under: ASP.NET Interview questions ·  ·  ·  · 


Ramireddy
3 · 40% · 12972
0
Liked
 
0
Asked



Submit

Your Comment


Sign Up or Login to post a comment.

"ASP.NET - Implmenting Custom interface with a dispose() method will be considered by GC for garbage collection?" rated 5 out of 5 by 2 readers
ASP.NET - Implmenting Custom interface with a dispose() method will be considered by GC for garbage collection? , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]