There are 5 access modifiers. Access modifiers define scope for members.
- Private: Accessible only with in the class.
- Protected: - Accessible with in the class and in derived classes.
- Friend (internal in C#):- Accessible anywhere within the current project.
- Protected friend (protected internal in C#):- Accessible with current project and derived classes.
- Public: - Accessible everywhere.
This interview question taken from my book Most asked .NET interview questions
See the following video on difference between string and string builder in C# and .NET training: -
Do not forget to see our .NET interview question videos
Click to view more from author's on Dotnet interview questions and answers