How a derived class can call a method from a base class.
Other classes should not have access, on the other hand.
My situation:
I have a base class in which I wrote a private method for registering some values.
private void register(string param1, int param2){
I did this to allow subclasses to register different things.
The problem is that the derived class cannot access private methods or fields of the base class.
This makes sense to me, since private funds are PRIVATE. I do not want the method to be publicly available, because other classes could not call this method.
Can someone provide a solution or lead me to a better design?
source share