Static and Sealed class differences

Saurabh Mahajan picture Saurabh Mahajan · Apr 25, 2013 · Viewed 84.6k times · Source
  1. Is there any class that be implemented in static class? means:

    static class ABC : Anyclass
    
  2. Is there any class which can be inherited in both sealed class and static class?
    means:

    static class ABC : AClass {}
    

    And

    sealed class ABC : AClass {}
    

May I be wrong in some extent?

Answer

Hossein Narimani Rad picture Hossein Narimani Rad · Apr 25, 2013

This may help you:

+--------------+---+-------------------------+------------------+---------------------+
|  Class Type  |   | Can inherit from others | Can be inherited | Can be instantiated | 
|--------------|---|-------------------------+------------------+---------------------+
| normal       | : |          YES            |        YES       |         YES         |
| abstract     | : |          YES            |        YES       |         NO          |
| sealed       | : |          YES            |        NO        |         YES         |
| static       | : |          NO             |        NO        |         NO          |
+--------------+---+-------------------------+------------------+---------------------+