Initializing base class portion of a derived class in a constructor

J

J.J. Feminella

I have source code similar to the following:

public class Vehicle
{
protected int dataA;
// ... additional fields
}

public class FourWheelVehicle : Vehicle
{
protected float dataXYZ;
// ... additional fields

// [ constructor goes here ]
}

public class SUV : FourWheelVehicle
{
// ... additional fields

// [ constructor goes here ]
}
 
D

Dilip Krishnan

WHats the question?

Try this http://www.yoda.arachsys.com/csharp/constructors.html



J.J. Feminella said:
I have source code similar to the following:

public class Vehicle
{
protected int dataA;
// ... additional fields
}

public class FourWheelVehicle : Vehicle
{
protected float dataXYZ;
// ... additional fields

// [ constructor goes here ]
}

public class SUV : FourWheelVehicle
{
// ... additional fields

// [ constructor goes here ]
}
 
J

J.J. Feminella

Dilip,

Sorry. I hit the Send button before I'd finished. Please see the post above.

Best wishes,
JJ

Dilip Krishnan said:
WHats the question?

Try this http://www.yoda.arachsys.com/csharp/constructors.html



J.J. Feminella said:
I have source code similar to the following:

public class Vehicle
{
protected int dataA;
// ... additional fields
}

public class FourWheelVehicle : Vehicle
{
protected float dataXYZ;
// ... additional fields

// [ constructor goes here ]
}

public class SUV : FourWheelVehicle
{
// ... additional fields

// [ constructor goes here ]
}

--
Regards,
Dilip Krishnan
MCAD, MCSD.net
dilipdotnet at apdiya dot com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top