Static field in class - Is it a re-instantiated for each static method call?

Posted by Jamie Dixon on Stack Overflow See other posts from Stack Overflow or by Jamie Dixon
Published on 2010-04-22T15:11:18Z Indexed on 2010/04/22 15:13 UTC
Read the original article Hit count: 267

Filed under:
|

If I have a static class with a static field such as:

private static myField = new myObject();

I then have a bunch of static methods that use myField.

Is myField re-instantiated for each method call? My guess is that it's instantiated the first time a method is called that uses it and it remains in memory until the GC clears it up?

Cheers for any pointers :-)

© Stack Overflow or respective owner

Related posts about c#

Related posts about static