Thursday, October 11, 2012

.NET Interview questions and answers: -What are different access modifiers?

Taken from my book.NET interview questions
There are 5 access modifiers. Access modifiers define scope for members.

·     Private:  Accessible only with in the class.
·     Protected: - Accessiblewith 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.


One of interesting .NET interview question: -What is the difference between string and string builder ?

No comments: