Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default access modifier of a class?

Tags:

.net

asp.net

What is the default access modifier of a class?

like image 263
NayeemKhan Avatar asked Aug 17 '10 05:08

NayeemKhan


1 Answers

internal, if defined directly in the namespace (probably most classes):

Internal is the default if no access modifier is specified

For classes within other classes, the default is private, like class members:

The access level for class members and struct members, including nested classes and structs, is private by default.

Source: http://msdn.microsoft.com/en-us/library/ms173121.aspx

like image 90
Kobi Avatar answered Oct 09 '22 00:10

Kobi