The way I understand it, having a member variable declared as static in a no-static class causes that member variable to be unique no-matter the number of instances of that class.
Now, what happen to a static method declared in non-static class? And (Most importantly), what the point of declaring a static method in a non-static class?
Thanks for helping
If the method has something to do with the type but not the instance then it can be static.
DateTime.Parse
and Int32.Parse
are examples.
It's useful for creating factory methods which are not members of any object but which need access to the internals of an object in order to initialize it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With