0

'm working on a C# project where I have an abstract base class Employee with a parameterized constructor Employee(string name). My derived class FullTimeEmployee has a constructor that takes three parameters (string name, double salary, int vacationDays). Inside the FullTimeEmployee constructor, I'm trying to initialize the base class constructor using base(name), but it seems to reference the constructor of the derived class instead of the intended base class constructor. This results in the error message "a constructor declared in a type with parameter list must have 'this' constructor initializer". I've verified that the constructor call is correct and matches the parameter of the base class constructor. What might be causing this issue, and how can I correctly initialize the base class constructor in my derived class?

New contributor
Smoker is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.