• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Today's fascinating C# quiz"

Collapse

  • AtW
    replied
    Originally posted by DimPrawn View Post


    All further fascinating C# quizzes are cancelled until further notice.


    Give us some assembly instead, maybe we'll bait Churchill with it ...

    Leave a comment:


  • OwlHoot
    replied
    Originally posted by DimPrawn View Post


    All further fascinating C# quizzes are cancelled until further notice.
    NOOO! They were just getting interesting!

    aussielong is only moaning because he had no idea what the answer was (any more than I did)

    Leave a comment:


  • aussielong
    replied
    Originally posted by minestrone View Post
    Well I liked them dim.
    Your posts have given me the mental image of a football hooligan who recently joined a book club and got into cooking. A real renaissance man.

    Leave a comment:


  • aussielong
    replied
    Originally posted by eek View Post
    don't listen to AussiePong....

    He makes Sas looking interesting. If you find interesting questions just ask them people will reply, answer or insult as appropriate...
    Here it is. Intellectual heavy weight #2.

    I've done a join the dots on your posts and the mental image looks like a donkey hitting a typewriter.

    You make Ban ki-moon look useful.

    You should consider a new alias: G-eek

    And lastly, have you any idea how extraordinarily dull your posts are? Liven up a bit. Read before you post. We want to be entertained. This is not a blog. You only live once, do it better.

    Leave a comment:


  • alluvial
    replied
    +1

    Leave a comment:


  • eek
    replied
    Originally posted by DimPrawn View Post


    All further fascinating C# quizzes are cancelled until further notice.
    don't listen to AussiePong....

    He makes Sas looking interesting. If you find interesting questions just ask them people will reply, answer or insult as appropriate...

    Leave a comment:


  • minestrone
    replied
    Well I liked them dim.

    Leave a comment:


  • DimPrawn
    replied
    Originally posted by aussielong View Post
    Have you thought of changing your name to "Dull Prawn".

    For f$@@s sake. Have you got no life?

    Who gives a sh1t about this stuff? What are you trying to prove? That you are clever? Who f€¥¥£g cares man. Can't you come up with something original that adds value to the world?

    You're better than this.


    All further fascinating C# quizzes are cancelled until further notice.

    Leave a comment:


  • MyUserName
    replied
    Originally posted by EternalOptimist View Post
    I'm a contractor in business.
    I maximise my profits,so youse can all eat a big fat one, with your c malarkey


    Don't worry, you're not the only one who did not know the answer.

    Leave a comment:


  • AtW
    replied
    Originally posted by aussielong View Post
    Have you thought of changing your name to "Dumb Prawn".

    For f$@@s sake. Have you got no wife?

    Who gives a sh1t about this stuff? What are you trying to prove? That you are clever? Who f€¥¥£g cares man. Can't you come up with something original that adds value to the world?

    You're better than this.
    FTFY

    Leave a comment:


  • aussielong
    replied
    Originally posted by DimPrawn View Post
    This exampled assumes you are creating an instance of the derived class.

    1st y is initialized to 1, that's because fields are initialized before constructors are called.

    Then then call to the base class constructor is made. So point D.

    Then as before, fields are initialized before constructors, so point A (x = 1).

    Then the base class constructor body B and finally the body of the derived constructor E, because base class constructor bodies execute before derived class constructor bodies.

    With C#, it's never as you think it is.
    Have you thought of changing your name to "Dull Prawn".

    For f$@@s sake. Have you got no life?

    Who gives a sh1t about this stuff? What are you trying to prove? That you are clever? Who f€¥¥£g cares man. Can't you come up with something original that adds value to the world?

    You're better than this.

    Leave a comment:


  • EternalOptimist
    replied
    I'm a contractor in business.
    I maximise my profits,so youse can all eat a big fat one, with your c malarkey


    Leave a comment:


  • DimPrawn
    replied
    Originally posted by VectraMan View Post
    Does that mean Base() is called with an unititialised number because D is executed before A?

    I'd have thought ACDBE.
    This exampled assumes you are creating an instance of the derived class.

    1st y is initialized to 1, that's because fields are initialized before constructors are called.

    Then then call to the base class constructor is made. So point D.

    Then as before, fields are initialized before constructors, so point A (x = 1).

    Then the base class constructor body B and finally the body of the derived constructor E, because base class constructor bodies execute before derived class constructor bodies.

    With C#, it's never as you think it is.

    Leave a comment:


  • VectraMan
    replied
    Originally posted by DimPrawn View Post
    C,D,A,B,E
    Does that mean Base() is called with an unititialised number because D is executed before A?

    I'd have thought ACDBE.

    Leave a comment:


  • DimPrawn
    replied
    Code:
    public class Base
    {
    int x = 1; // Point A
    public Base (int x)
    {
    ... // Point B
    }
    }
    public class Derived : Base
    {
    int y = 1; // Point C
    public Derived (int x)
    : base (x + 1) // Point D
    {
    ... // Point E
    }
    }

    C,D,A,B,E

    is the order anyway.

    Hope you all enjoyed, more C# fun next week.

    Leave a comment:

Working...
X