Static Classes

A good example is System.Math

Cannot implement an interface and cannot be derived from
Cannot be instantiated from using the new keyword (as they are sealed)
All members must be declared static
Cannot contain any instance members
Remains in memory for the lifetime of the app domain in which your code is running
Is the same as a non-static class that contains only static members
Any constructors must also be declared static

Non Static Classes

can contain a static constructor
can contain static methods, properties or events

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext