In C++ you can write:
private:
int w;
string x;
protected:
int y;
string z;
is there something similar in C# ?
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.
No, there are no regions with a specific access type in C#. Every member of a
classorstructmust have an explicit access modifier or accept the default access modifierprivate.Also, on the topic of access modifiers in C# compared to C++, C# has two additional modifiers
internalandprotected internal. The modifierinternalmeans that it is visible only within the defining assembly andprotected internalmeansprotectedorinternal(NOTprotectedandinternal).