I do not think it can be done, but I'm curious. Is it possible to make a protected variable in the superclass private in its subclass.
For example, I have three classes SuperClass, SubClass : SuperClassand SubCLass2 : SubClass.
I want to have access to a variable protected string[] commandsthat is in SuperClassfrom SubClass, but denies access to it from SubClass2.
If this is not possible, do you still need to achieve the same effect?
source
share