0

I have one static member in non static class - if I will initialize this field with some value - does other (new) instances of this class will have the same value in this field?

curiousity
  • 4,703
  • 8
  • 39
  • 59

1 Answers1

1

Yeah all instances of the same class share the same value of static member.

fsacer
  • 1,382
  • 1
  • 15
  • 23
  • 1
    I suspect you mean "all instances" - and it's not that each instance has the same value, it's that the variable is associated with the type, not *any* instances. – Jon Skeet Jun 11 '15 at 10:48