Categories

May 6 in C Sharp (C#)
Q: Which are the access modifiers available in C#?

1 Answer

May 6

Following are the access modifiers generally used for accessibility:

Public: If you define an attribute or method as public, it can be accessed from any code of the project.

Private: A private defined attribute or method can be accessed by any code within the containing class only.

Protected: If you define the method or attribute as protected it can be accessed by any method in the inherited classes and any method within the same class.

Internal: If you define an attribute or a method as internal, it is restricted to classes within the current position assembly.

Protected internal: If you define an attribute or method as protected internal, access is restricted to classes within the current project assembly or types derived from the containing class.

Click here to read more about C Sharp
Click here to read more about Insurance

Related questions

Madanswer
Oct 18, 2019 in C Sharp (C#)
Oct 18, 2019 in C Sharp (C#)
Oct 18, 2019 in C Sharp (C#)
...