Yes you can do it. Just add the abstract keyword and remove the implementation. There was obviously a trap. Any class that inherits from your abstract class will have to implement GetData
. Depending on how many classes are children of MyAbstract
, this can lead to a lot of work and code duplication.
In your case, when this method is declared as an interface that implements MyAbstract
, you can simply completely abandon GetData
and rely on declaring this function in ITest
.
source share