The class “MyDerived” is derived from the class “MyBase”. Therefore, in addition
ID: 3627992 • Letter: T
Question
The class “MyDerived” is derived from the class “MyBase”. Therefore, in addition to its data member ‘intDerived’ it inherits ‘strBase’ from the base class.class MyBase
{
protected string strBase;
}
class MyDerived : MyBase
{
private int intDerived;
}
Question:
What needs to be implemented so that the following statement is possible?
MyDerived myd = new MyDerived(10, "my_derived_class");
Please include in your answer a sample C# implementation.
*******************************************************************************
also what is the difference between including a dll in a project and including the using directive in your code?
Explanation / Answer
class MyBase
{
protected string strBase;
}
class MyDerived : MyBase
{
private int intDerived;
MyDeriver(int k, string str)
{
intDerived = k;
MyBase::strBase = str;
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.