I have a abstract base class.
I have 2 derived classes from this base class.
Is there anyway that one of my classes can ignore the string parameter in the abstract overide usage? Or do I have to just send in a blank one and ignore it? (making readability drop slightly)
Can I have one function that has some sort of optional parameter so that both of the following derived classes would compile?
PS - The following code is riddled with in-compilable code for the example of what I would like to do
PS PS - Yes i have compiled the following code already - see above comment for outcome
public abstract class MyBaseClass
{ //optional string?
public abstract void FunctionCall(int i, string s = "");
}
public class MyDerivedClass : MyBaseClass
{
public override void FunctionCall(int i)
{
MessageBox.Show(i.ToString());
}
}
public class YourDerivedClass : MyBaseClass
{
public override void FunctionCall(int i, string s)
{
MessageBox.Show(s + " " + i.ToString());
}
}