473,387 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Nov 15 '05 #1
7 1560
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!
Nov 15 '05 #2
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
Nov 15 '05 #3
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" <ja*********@hotmail.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
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!

Nov 15 '05 #4
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" <ve******@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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" <ja*********@hotmail.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
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!


Nov 15 '05 #5
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" <ve******@comcast.net> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
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

Nov 15 '05 #6
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:
http://www.pobox.com/~skeet/csharp/constructors.html

--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com
"Ron Vecchi" <ve******@comcast.net> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
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

Nov 15 '05 #7
Thanks for the help

Ron
"Ron Vecchi" <ve******@comcast.net> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
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

Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John | last post by:
Hi, I am trying to create a class heirarchy similar to the following: // base interface class ICar { public: virtual void start() = 0; }; // add members to that interface, but retain base...
8
by: Digital Puer | last post by:
I made the following table to help me (re)learn inheritence basics. Can someone check if it's correct? This table requires a courier-like font. Java C++ ---- ...
7
by: Bo Peng | last post by:
Dear List, I have a class that may or may not have several features. For example, there might be "partition" to d_data of obj. The code is like (please ignore grammar mistakes): ...
7
by: preetam | last post by:
Hi, This question is more towards design than towards c++ details. By looking at books on design patterns and various google threads on the same topic, I see that composition is favoured to...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
9
by: Player | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all. I am in the process of teaching myself C# and I think I am doing OK. I have learnt how to how to call the right constructor of a...
1
by: Ruffin Bailey | last post by:
I want to declare an interface that forces the presence of a certain constructor (in this case, "Sub New(ByVal ds As DataSet)"). When I try, I get a 'Sub New' cannot be declared in an...
5
by: Neelesh Bodas | last post by:
This might be slightly off-topic. Many books on C++ consider multiple inheritence as an "advanced" concept. Bruce Eckel says in TICPP, volume 2 that "there was (and still is) a lot of...
8
by: Mike - EMAIL IGNORED | last post by:
I have a class that may or may not be inherited. Its constructor calls a function that should be called only if the class is not inherited. Is there a way to tell, other than simply passing a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.