Click here to Skip to main content
15,921,531 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: MQOTD Pin
Nagy Vilmos16-Apr-15 22:31
professionalNagy Vilmos16-Apr-15 22:31 
GeneralRe: MQOTD Pin
chriselst16-Apr-15 22:34
professionalchriselst16-Apr-15 22:34 
GeneralRe: MQOTD Pin
Corporal Agarn17-Apr-15 3:05
professionalCorporal Agarn17-Apr-15 3:05 
GeneralRe: MQOTD Pin
Stefto17-Apr-15 3:51
professionalStefto17-Apr-15 3:51 
GeneralXKCD OTD PinPopular
OriginalGriff16-Apr-15 20:22
mveOriginalGriff16-Apr-15 20:22 
GeneralRe: XKCD OTD Pin
Nagy Vilmos16-Apr-15 22:03
professionalNagy Vilmos16-Apr-15 22:03 
GeneralFriday Programming Quiz PinPopular
PIEBALDconsult16-Apr-15 19:50
mvePIEBALDconsult16-Apr-15 19:50 
GeneralRe: Friday Programming Quiz Pin
Agent__00716-Apr-15 20:23
professionalAgent__00716-Apr-15 20:23 
Interesting and I am glad I guessed it correctly. Blush | :O

As I know them, static members are associated with the type and not the instance. So, although the Derived class has the static property, it's still associated with the Base class. And hence the static ctor of the Derived class doesn't get called until you instantiate it. So, unless you explicitly have that property in the Derived class (since it can't be overridden), the output would be:
I am Base
I am Base
I am Derived
Here's an SO question[^] the accepted answer of which you might find interesting (of course, I am sure you already know this Smile | :) ).

Or it's due to "Calling static methods of a type does not force the system to initialize the type."

-- EDIT
Correct me if I am wrong. Roll eyes | :rolleyes:
You have just been Sharapova'd.


modified 17-Apr-15 3:02am.

JokeRe: Friday Programming Quiz Pin
RUs12316-Apr-15 21:33
RUs12316-Apr-15 21:33 
JokeRe: Friday Programming Quiz Pin
Johnny J.16-Apr-15 21:38
professionalJohnny J.16-Apr-15 21:38 
GeneralRe: Friday Programming Quiz Pin
Nagy Vilmos16-Apr-15 22:09
professionalNagy Vilmos16-Apr-15 22:09 
GeneralRe: Friday Programming Quiz Pin
Johnny J.16-Apr-15 23:06
professionalJohnny J.16-Apr-15 23:06 
JokeRe: Friday Programming Quiz Pin
Stefto17-Apr-15 3:52
professionalStefto17-Apr-15 3:52 
QuestionThe Friday Post!™ Pin
Vikram A Punathambekar16-Apr-15 18:51
Vikram A Punathambekar16-Apr-15 18:51 
AnswerRe: The Friday Post!™ Pin
Roger Wright16-Apr-15 19:16
professionalRoger Wright16-Apr-15 19:16 
AnswerRe: The Friday Post!™ Pin
Brady Kelly16-Apr-15 19:30
Brady Kelly16-Apr-15 19:30 
GeneralRe: The Friday Post!™ Pin
Roger Wright16-Apr-15 19:44
professionalRoger Wright16-Apr-15 19:44 
GeneralRe: The Friday Post!™ Pin
Mycroft Holmes16-Apr-15 22:39
professionalMycroft Holmes16-Apr-15 22:39 
AnswerRe: The Friday Post!™ Pin
King Fisher16-Apr-15 19:34
professionalKing Fisher16-Apr-15 19:34 
GeneralRe: The Friday Post!™ Pin
Mycroft Holmes16-Apr-15 22:40
professionalMycroft Holmes16-Apr-15 22:40 
GeneralRe: The Friday Post!™ Pin
King Fisher16-Apr-15 23:29
professionalKing Fisher16-Apr-15 23:29 
AnswerRe: The Friday Post!™ Pin
HobbyProggy16-Apr-15 20:11
professionalHobbyProggy16-Apr-15 20:11 
AnswerRe: The Friday Post!™ Pin
Stefto16-Apr-15 20:51
professionalStefto16-Apr-15 20:51 
AnswerRe: The Friday Post!™ Pin
Dinesh.V.Kumar16-Apr-15 21:32
Dinesh.V.Kumar16-Apr-15 21:32 
GeneralRe: The Friday Post!™ Pin
King Fisher16-Apr-15 23:23
professionalKing Fisher16-Apr-15 23:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.