R
RP
I completely understand that a static member belongs to the type and is shared between instances of that type in an application scope.
So my question is really, what constitutes an application scope?
Let's say that I have a windows form application made up of several classes and one of those classes, StaticExampleClass, has a static member called SharedMember.
Example:
public class StaticExampleClass
{
public static int SharedMember = 0;
}
If I create 2 instances of the StaticExampleClass in my application there is only one value for SharedMember because it is static.
What happens if I start up another instance of the application? Now I have two winforms running on the same machine at the same time each with two instances of StaticExampleClass. Do all four instances of StaticExampleClass share the same value for SharedMember?
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
So my question is really, what constitutes an application scope?
Let's say that I have a windows form application made up of several classes and one of those classes, StaticExampleClass, has a static member called SharedMember.
Example:
public class StaticExampleClass
{
public static int SharedMember = 0;
}
If I create 2 instances of the StaticExampleClass in my application there is only one value for SharedMember because it is static.
What happens if I start up another instance of the application? Now I have two winforms running on the same machine at the same time each with two instances of StaticExampleClass. Do all four instances of StaticExampleClass share the same value for SharedMember?
--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-