C
C#16mo ago
noah

✅ whats causin the error?

3 Replies
exokem
exokem16mo ago
the constructor for the Worker class requires two parameters which you have not provided it needs some int for the id and another int for the number of years in the parentheses
Playboi17
Playboi1716mo ago
When a class doesn’t declare a constructor with no parameters, you can’t use a constructor with no parameters. That includes object initialization If you want to do that, in the worker class you need
public Worker()
{
//object initialization
}
public Worker()
{
//object initialization
}
noah
noah16mo ago
yup i fixed it thank you so much guys