top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Which class acts as a base class for all exceptions in C#?

+1 vote
265 views
Which class acts as a base class for all exceptions in C#?
posted May 25, 2017 by Jdk

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

C# exceptions are represented by classes. The exception classes in C# are mainly directly or indirectly derived from the System.Exception class. Some of the exception classes derived from the System.Exception class are the System.ApplicationException and System.SystemException classes.

answer May 30, 2017 by Manikandan J
Similar Questions
+1 vote
using System;

namespace CareerRideTest
{    
  class A
  {    
    public A()
    {
      Console.WriteLine("I am in A");
    }
  }

  class B : A
  {
    public B()
    {
      Console.WriteLine("I am in B");
    }
  }

  class C : B
  {
    static C()
    {
      Console.WriteLine("I am in Static C");
    }
    public C()
    {
      Console.WriteLine("I am in C");
    }
  }    

  class MainClass
  {
    static void Main(string[] args)
    {
      C obj = new C();    
      Console.ReadKey();    
    }
  }    
}
...