Wednesday 26 June 2013

Scope of public/private/friend/protected/protected friend

What is the Scope of public/private/friend/protected/protected friend?

Scope of public/private/friend/protected/protected friend.

Visual Basic/Visual C#

Public/public All members in all classes and projects.

Private/private Members of the current class only.

Friend/internal All members in the current project.

Protected/protected All members in the current class and in classes derived from this member’s class. Can be used only in member definitions, not for class or module definitions.

Protected Friend/protected internal All members in the current project and all members in classes derived from this member’s class. Can be used only in member definitions, not for class or module definitions.


EmoticonEmoticon