Default Access Modifier in C#

This is very basic thing we should come to know, so that i just recall this concept in this post.

An enum has default modifier as public

A class has default modifiers as Internal .


An interface has default modifier as public

A struct has default modifier as Internal

A methods, fields, and properties has default access modifier as "Private" if no modifier is specified.

  
public
The type or member can be accessed by any other code in the same assembly or another assembly that references it.

private
The type or member can be accessed only by code in the same class or struct.

protected
The type or member can be accessed only by code in the same class or struct, 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.