I have a class ClassA
that is a base class of other classes. I want this class constructor to be internal and protected so that it can't be inherited and instantiated from outside of my assembly (I can't make it sealed because I have other internal classes inheriting from it, you can see my other related question here) so I modified it to be like this:
public abstract ClassA{
internal protected ClassA(){
}
}
I have been told that this won't work as the combination internal protected
is interpreted as internal
OR protected
which apparently makes the constructor only protected
:( (visible from the outside)
Questions
- If that is true, why is
internal protected
interpreted asinternal
ORprotected
and not asinternal
ANDprotected
? - Is there a way I can declare a constructor internal and protected?