Someone I know just asked me to explain this statement from the MSDN and I was dumbfounded.
A constant or type declaration is implicitly a static member.
That phrase "or type declaration is implicitly a static member," just doesn't make sense to me.
What does that mean?
It makes sense to me that a type declaration is implicitly a static member
.
Because if you have class:
class Foo
{
public class Bar
{
}
}
You cannot access the class Bar
by:
Foo f = new Foo();
Bar b =new f.Bar();
(I am not even sure how to write it in order for it to make sense).
If you want to access Bar
class, you will need to do as follows:
Bar b = new Foo.Bar()
You access it via the class rather than an instance. of an object
Hence, Bar
is a static member of Foo
.
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