access modifier in C#

All types and type members in C# have access modifiers. C# allows public inheritance only.
```
public class Bicycle {
    public void Pedal() { }
}
```
The access modifiers control whether they can be used from other code in your assembly or other assemblies. An assembly is a .dll or .exe created by compiling one or more .cs files in a single compilation. 
access modifier | meaning
----- | -----
public | The type or member can be accessed by any other code in the same assembly or another assembly that references it. The accessibility level of public members of a type is controlled by the accessibility level of the type itself.
protected internal | The type or member can be accessed by any code in the assembly in which it's declared, or from within a derived class in another assembly.
protected | The type or member can be accessed only by code in the same class, or in a class that is derived from that class.
internal | The type or member can be accessed by any code in the same assembly, but not from another assembly. In other words, internal types or members can be accessed from code that is part of the same compilation.
private protected | The type or member can be accessed by types derived from the class that are declared within its containing assembly.
private | The type or member can be accessed only by code in the same class or struct.

Summary table
Caller's location | public | protected internal | protected | internal | private protected | private
----- | ----- | ----- | ----- | ----- | ----- | ----- 
Within the class | Yes | Yes | Yes | Yes | Yes | Yes
Derived class (same assembly) | Yes | Yes | Yes | Yes | Yes | No
Non-derived class (same assembly) | Yes | Yes | No | Yes | No | No
Derived class (different assembly) | Yes | Yes | Yes | No | No | No
Non-derived class (different assembly) | Yes | No | No | No | No | No

<b>Class, record, and struct accessibility</b>
Classes, records, and structs declared directly within a namespace (in other words, that aren't nested within other classes or structs) can be either public or internal. internal is the default if no access modifier is specified.
Struct members, including nested classes and structs, can be declared public, internal, or private. Class members, including nested classes and structs, can be public, protected internal, protected, internal, private protected, or private. Class and struct members, including nested classes and structs, have private access by default. Private nested types aren't accessible from outside the containing type.
Derived classes and derived records can't have greater accessibility than their base types. You can't declare a public class B that derives from an internal class A. If allowed, it would have the effect of making A public, because all protected or internal members of A are accessible from the derived class.

<b>Class, record, and struct member accessibility</b>
Class and record members (including nested classes, records and structs) can be declared with any of the six types of access. Struct members can't be declared as protected, protected internal, or private protected because structs don't support inheritance.
Normally, the accessibility of a member isn't greater than the accessibility of the type that contains it. However, a public member of an internal class might be accessible from outside the assembly if the member implements interface methods or overrides virtual methods that are defined in a public base class.
The type of any member field, property, or event must be at least as accessible as the member itself. Similarly, the return type and the parameter types of any method, indexer, or delegate must be at least as accessible as the member itself. For example, you can't have a public method M that returns a class C unless C is also public. Likewise, you can't have a protected property of type A if A is declared as private.
User-defined operators must always be declared as public and static. 
Finalizers can't have accessibility modifiers.