KyaPoocha.com

Huge Collection of Interview Questions


‘C# Interview Questions’ - KyaPoocha.com

Is there a way to force garbage collection? 

Yes. Set all references to null and then call System.GC.Collect(). If you need to have some objects destructed, and System.GC.Collect() doesn’t seem to be... Read more »

Does C# support try-catch-finally blocks? 

Yes. Try-catch-finally blocks are supported by the C# compiler.Here’s an example of a try-catch-finally block: using System; public class TryTest { static... Read more »

How do I simulate optional parameters to COM calls? 

You must use the Missing class and pass Missing.Value (in System.Reflection) for any values that have optional parameters.  Read more »

How do I make a DLL in C#? 

You need to use the /target:library compiler option  Read more »

How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#? 

You want the lock statement, which is the same as Monitor Enter/Exit: lock(obj) { // code } translates to: try { CriticalSection.Enter(obj); // code } finally { CriticalSection.Exit(obj); }  Read more »

Page 11 of 11« First...«7891011