2
Reply

For the following class, what methods would be included i

Noe Torres

Noe Torres

May 14 2013 7:32 PM
1.3k

public class CallStack
 {
  public void Test()
  {
   try
   {
    this.A();
   }
   catch( Exception e )
   {
    Console.WriteLine( e.StackTrace );
   }
  }

  protected void A()
  {
   this.B();
  }

  protected void B()
  {
   try
   {
    this.C();
   }
   catch( Exception /*e*/ )
   {
    throw;
   }
  }
 
  protected void C()
  {
   this.D();
  }

  protected void D()
  {
   try
   {
    this.E();
   }
   catch( Exception e )
   {
    throw e;
   }
  }

  protected void E()
  {
   this.Throw();
  }

  protected void Throw()
  {
   throw new Exception( "An Exception occurred" );
  }
 }


Answers (2)