❔ Why do we need to provide values for base class we are inheriting from?
For example i have this:
Why do i need to base the Id back to the base class? what does it even do? How does the flow work? How does it know to set the id of the answer class because we are passing it to the base class?
3 Replies
base(id)
just calls the constructor of the base class with the argument id
The constructor of the base class likely sets some Id
property in the class itself to the id passsed into the constructorI mean this is the class:
I just dont get how from this methode:
We get the Id in our new initialized class
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.