what is the difference between a sealed class and a static class?

  1. A sealed class is a c# class which can't be derived by another c# class. sealed modifier is used to mark the class as a sealed class.
  2. A sealed class can be instantiated, but can't be inherited.
  3. A static class is a c# class which comprises of only static methods and members. The members of a static class are initialized at some random time before any member or method of it is first called.
  4. A static class can't be instantiated and also inherited, because it's marked static.
  1. A sealed class is a c# class which can’t be derived by another c# class. sealed modifier is used to mark the class as a sealed class.
  2. A sealed class can be instantiated, but can’t be inherited.
  3. A static class is a c# class which comprises of only static methods and members. The members of a static class are initialized at some random time before any member or method of it is first called.
  4. A static class can’t be instantiated and also inherited, because it’s marked static.
Sriram Mannava
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply

Your email address will not be published. Required fields are marked *