Constructor inheritence

  • Thread starter Thread starter Ron Vecchi
  • Start date Start date
R

Ron Vecchi

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
 
Wouldn't it have been quicker to compile this and see what happened
rather than ask a question?

Jasper Kent
 
Ron,
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


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
 
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.
 
Back
Top