If you are creating a .NET or .NET Core application, you are likely to come across classes, constructors, fields, properties or methods in your application.

Using Visual Studio 2019, I’ve created a Console Application that tests how these work when you use the static modifier and when it is absent.

Using an example static and non-static class, we will see if we can use a mixture of non-static methods in a static class and vice-versa. We will also see how static methods behave when using separate threads.

And what gets ran first? A static constructor, or a non-static constructor?

► More Information: https://www.roundthecode.com/dotnet/the-difference-between-static-and-non-static-classes-and-methods

#csharp #visualstudio #dotnet

The Difference between Static and Non Static Classes and Methods in C#
1.10 GEEK