C
C#2y ago
noah

✅ whats causin the error?

3 Replies
exokem
exokem2y 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
Connor
Connor2y 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
noahOP2y ago
yup i fixed it thank you so much guys
Want results from more Discord servers?
Add your server