Constructor inheritence

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Vecchi

    Constructor inheritence

    Latley I have been messing around with polymorphsim and inheritence and
    really enjoying the benefits.


    public myclass() {
    'mycode
    }

    public myclass(string s) : this() {
    'more code
    }

    ----QUESTION---
    which happens first? mycode or more code
    --------------------

    Thanks,
    Ron Vecchi



  • Jasper Kent

    #2
    Re: Constructor inheritence

    Wouldn't it have been quicker to compile this and see what happened
    rather than ask a question?

    Jasper Kent

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Randy A. Ynchausti

      #3
      Re: Constructor inheritence

      Ron,
      [color=blue]
      > Latley I have been messing around with polymorphsim and inheritence and
      > really enjoying the benefits.
      >
      >
      > public myclass() {
      > 'mycode
      > }
      >
      > public myclass(string s) : this() {
      > 'more code
      > }
      >
      > ----QUESTION---
      > which happens first? mycode or more code[/color]


      If: myclass aClass = new myclass( );

      then: only "mycode" will execute


      if myclass aClass = new myclass( @"Hello" );

      then: mycode will execute and then more code will execute


      Hope that helps!

      Regards,

      Randy


      Comment

      • Ron Vecchi

        #4
        Re: Constructor inheritence

        With the amount of questions I have No.

        But thanks for the help, glad to see that theres still people that are
        willing to help someone in need and not just give useless information.


        "Jasper Kent" <jasper_kent@ho tmail.com> wrote in message
        news:uNifvoJdDH A.3520@tk2msftn gp13.phx.gbl...[color=blue]
        > Wouldn't it have been quicker to compile this and see what happened
        > rather than ask a question?
        >
        > Jasper Kent
        >
        > *** Sent via Developersdex http://www.developersdex.com ***
        > Don't just participate in USENET...get rewarded for it![/color]


        Comment

        • Vlastimil Adamovsky

          #5
          Re: Constructor inheritence

          I really like people that are not sarcastic ;-)

          Vlastik

          --
          So what makes me an expert?
          I'm not, and don't claim to be, unfortunately, neither are many, if not
          most, of those who do make this claim

          "Ron Vecchi" <vencenzo@comca st.net> wrote in message
          news:%23BCWODKd DHA.2436@TK2MSF TNGP09.phx.gbl. ..[color=blue]
          > With the amount of questions I have No.
          >
          > But thanks for the help, glad to see that theres still people that are
          > willing to help someone in need and not just give useless information.
          >
          >
          > "Jasper Kent" <jasper_kent@ho tmail.com> wrote in message
          > news:uNifvoJdDH A.3520@tk2msftn gp13.phx.gbl...[color=green]
          > > Wouldn't it have been quicker to compile this and see what happened
          > > rather than ask a question?
          > >
          > > Jasper Kent
          > >
          > > *** Sent via Developersdex http://www.developersdex.com ***
          > > Don't just participate in USENET...get rewarded for it![/color]
          >
          >[/color]


          Comment

          • Vlastimil Adamovsky

            #6
            Re: Constructor inheritence

            try it out

            --
            So what makes me an expert?
            I'm not, and don't claim to be, unfortunately, neither are many, if not
            most, of those who do make this claim

            "Ron Vecchi" <vencenzo@comca st.net> wrote in message
            news:eaode9IdDH A.3948@TK2MSFTN GP11.phx.gbl...[color=blue]
            > Latley I have been messing around with polymorphsim and inheritence and
            > really enjoying the benefits.
            >
            >
            > public myclass() {
            > 'mycode
            > }
            >
            > public myclass(string s) : this() {
            > 'more code
            > }
            >
            > ----QUESTION---
            > which happens first? mycode or more code
            > --------------------
            >
            > Thanks,
            > Ron Vecchi
            >
            >
            >[/color]


            Comment

            • Michael Mayer

              #7
              Re: Constructor inheritence

              I'm sure Jon would respond, but in the mean-time I'll point you to his page
              on constructors which has a lot of really good info:
              Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.




              --
              Mike Mayer

              mike@mag37.com


              "Ron Vecchi" <vencenzo@comca st.net> wrote in message
              news:eaode9IdDH A.3948@TK2MSFTN GP11.phx.gbl...[color=blue]
              > Latley I have been messing around with polymorphsim and inheritence and
              > really enjoying the benefits.
              >
              >
              > public myclass() {
              > 'mycode
              > }
              >
              > public myclass(string s) : this() {
              > 'more code
              > }
              >
              > ----QUESTION---
              > which happens first? mycode or more code
              > --------------------
              >
              > Thanks,
              > Ron Vecchi
              >
              >
              >[/color]


              Comment

              • Ron Vecchi

                #8
                Re: Constructor inheritence

                Thanks for the help

                Ron
                "Ron Vecchi" <vencenzo@comca st.net> wrote in message
                news:eaode9IdDH A.3948@TK2MSFTN GP11.phx.gbl...[color=blue]
                > Latley I have been messing around with polymorphsim and inheritence and
                > really enjoying the benefits.
                >
                >
                > public myclass() {
                > 'mycode
                > }
                >
                > public myclass(string s) : this() {
                > 'more code
                > }
                >
                > ----QUESTION---
                > which happens first? mycode or more code
                > --------------------
                >
                > Thanks,
                > Ron Vecchi
                >
                >
                >[/color]


                Comment

                Working...