You need to call the base class constructor. If you omit the call :base(...) , the baseless constructor of the base class is called. Since your base class does not have such a constructor, you get an error message.
public FHXTreeNode(FHXTreeNode<T> parent, T data) :base(parent, data) { }
Calling the parameterized constructor of the base class also obsolete the field initializations, since they are already assigned in the base class.
In C #, you cannot inherit constructors. You create a new constructor in a derived class that has the same signature as the base class constructor.
Your interface is also broken: you cannot declare methods as public abstract in the interface. Interface methods are always implicitly public and never have an implementation. Thus, these modifiers will be redundant and illegal.
Further, you cannot override using interface methods. You can override virtual / abstract methods from the base class. When you have a method that matches a method in an interface, that interface method is implemented.
Another mistake is that you reuse the type parameter for interface methods: void AddChild<T>(T child); wrong. This syntax is for introducing type parameters into a method. But you want to use the type parameter from the containing type. Therefore you should write AddChild(T child); .
There are also several stylistic issues: interface names must have the prefix I And I would avoid protected fields where possible.
source share