0 votes
in C Sharp by
Which are the access modifiers available in C#?

1 Answer

0 votes
by

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.

Related questions

0 votes
asked May 25, 2020 in JAVA by Robindeniel
0 votes
asked Jun 16, 2020 in C Sharp by Hodge
...