0
why 'static' appears in C#?
it seems difficult to understand why 'static' appears in C#?
5 Answers
+ 14
Same reason why static modifier exists for other languages. Static declares that the member belongs to the type/class itself rather than the object/instance of the class. In other words, a static member can be called directly using the class name without using the class object.
http://csharp.net-tutorials.com/classes/static-members/
+ 3
Static appears in c# in static classes and static members...this is because static class can be used as a convenient container for sets of methods that just operate on input parameters and do not have to get or set any internal instance fields.
The advantage of using static class is that compiler can check to make sure that no instance members are accidently added.the compiler will guarantee that instance of this class cannot be created.also static class cannot be inherited.
Similarly static members always will be accessed by class name Mr instance name...
0
If no other status or type besides 'static', what's its meaning to emphasis it alone? I think the course should give bigger picture of this.
0
It should be named as 'predefined' or 'inner-declared', other than 'static'. The later always induces me thinking of where's 'dynamic'.
- 2
is there 'dynamic'?