c# - Static Constructor in derived class getting invoked first then the base class -


i wondering, in c#, constructor concept is, base class cons should execute first, why seeing derived class static constructor getting called , base class cons. please explain ? :(

static constructors initialize class itself, must called before other static members accessed, , before creation of instances of class.

as ordering of calls static constructors within class hierarchy, should consider undefined. msdn page on static constructors:

the user has no control on when static constructor executed in program.


Comments

Popular posts from this blog

sql server - NHibernate incorrectly creating ManyToMany table - Cannot define PRIMARY KEY constraint on nullable column error -

All overlapping substrings matching a java regex -

c++ - Using OpenSSL in a multi-threaded application -