Posted on: 11/9/2012 1:07:12 AM | Views : 421

1.
what can be added to the following code snippet to ensure the Dispose method is always called before the Execute method returns?

class Datasource: IDisposable
{
     public void Dispose(){/*clean up*/}
}
class MyClass
{
 void Execute ()
           {
              var ds =new DataSource();
              ds.DoStuff();
              ds.Dispose();
            }
}
2. What will the console output be when DoExceptionalStuff() is executed, and why?
class MyClass { void DoExceptionalStuff() { try { ...

Go to the complete details ...