F
Frank Uray
Hi all
I have some little problems with inheriting ...
What I have and what I want to do is:
- Base class with one method "RunTest"
- Standard class inherits from Base class
- In Standard class I want to add more code to method "RunTest"
- I wnat to make sure method "RunTest" from Base class is also executed
without having "base.RunTest" in Standard class
I hope you know what I mean ... )
Is there any way to do this ??
Thanks for any comments !
Best regards
Frank
Here is my sample code:
public class clsBase
{
public virtual void RunTest()
{
Console.WriteLine("clsBase");
}
}
public class clsStandard : clsBase
{
public override void RunTest()
{
//base.RunTest(); I dont want to have this extra line !!
Console.WriteLine("clsStandard");
}
}
I have some little problems with inheriting ...
What I have and what I want to do is:
- Base class with one method "RunTest"
- Standard class inherits from Base class
- In Standard class I want to add more code to method "RunTest"
- I wnat to make sure method "RunTest" from Base class is also executed
without having "base.RunTest" in Standard class
I hope you know what I mean ... )
Is there any way to do this ??
Thanks for any comments !
Best regards
Frank
Here is my sample code:
public class clsBase
{
public virtual void RunTest()
{
Console.WriteLine("clsBase");
}
}
public class clsStandard : clsBase
{
public override void RunTest()
{
//base.RunTest(); I dont want to have this extra line !!
Console.WriteLine("clsStandard");
}
}