Ok this is bugging me.. I know I've read it somewhere and google isn't helping.
What is the accessibility level of a method that does not specify an access modifier?
void Foo()
{
//code
}
I want to say internal
but I'm not 100% sure.
The default accessibility for a type is internal
, but the default accesibility of that type's members depends on the type.
Generally speaking, members of a class are private
by default, where as members of a struct are public
by default. This varies by language; default struct access modifiers for C++ are public, where as for C#, they are private.