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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
privateby default, where as members of a struct arepublicby default. This varies by language; default struct access modifiers for C++ are public, where as for C#, they are private.