When we are implementing both interface and base class in any derived class than we must have to follow the sequnce where we have to first put base class and than Interface.
Ex: If we don’t follow the sequnce than we will get error “Base class must come before any interface”.
public class BaseClass
{
//
}
public interface IMyInterface
{
//
}
public class DerivedClass : IMyInterface, BaseClass //ERROR HERE : CS1722: Base class 'BaseClass' must come before any interface.
{
//
}
Why is it necessary to extend the class first and then implement the inteface?