C# – ‘internal’ vs ‘protected’

The public/private access modifiers are straightforward: public means everything has access while private means only the class has access. The internal/protected access modifiers are a little more complicated. In other words, internal means it’s “private” to the assembly and protected means it’s “private” to the class and its subclasses. To illustrate the difference, I’ll show … Read more

C# – Default access modifiers

Classes (and other types) are internal by default. Class members (methods/properties/fields) are private by default. These defaults are applied when you don’t explicitly declare an access modifier. Here’s an example: Since the access modifiers aren’t declared, it uses the defaults. The class is internal while all of the members are private. This is almost never … Read more