T
Tony Johansson
Hello!
Here I have an Interface called ITest and a class called MyClass which
derive this intrface.
As you can see I don't implement this method myTest in class MyClass because
i use the keyword abstract.
I have also another class called MyDerivedClass which is a sublass to
MyClass.
Now to my question when I implement this method myTest in class
MyDerivedClass I must use
the keyword override. I just wonder I have always used this override when
having a virtual method with the same signature in the base class. Can
somebody explain the reson for this using of override?
public interface ITest
{
void myTest();
}
abstract public class MyClass : ITest
{
abstract public void myTest;
...
}
public class MyDerivedClass : MyClass
{
public override void myTest()
{
}
}
//Tony
Here I have an Interface called ITest and a class called MyClass which
derive this intrface.
As you can see I don't implement this method myTest in class MyClass because
i use the keyword abstract.
I have also another class called MyDerivedClass which is a sublass to
MyClass.
Now to my question when I implement this method myTest in class
MyDerivedClass I must use
the keyword override. I just wonder I have always used this override when
having a virtual method with the same signature in the base class. Can
somebody explain the reson for this using of override?
public interface ITest
{
void myTest();
}
abstract public class MyClass : ITest
{
abstract public void myTest;
...
}
public class MyDerivedClass : MyClass
{
public override void myTest()
{
}
}
//Tony