0% found this document useful (0 votes)
38 views6 pages

Access Modifiers2

The document discusses the five access modifiers in C#: public, private, protected, internal, and internal protected. Public members can be accessed from any other code in the same or another assembly. Private members can only be accessed within the same class. Protected members can be accessed within the same class or subclasses. Internal members can be accessed within the same assembly, but not another. Internal protected members can be accessed within the same assembly or subclasses in other assemblies.

Uploaded by

dawar ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views6 pages

Access Modifiers2

The document discusses the five access modifiers in C#: public, private, protected, internal, and internal protected. Public members can be accessed from any other code in the same or another assembly. Private members can only be accessed within the same class. Protected members can be accessed within the same class or subclasses. Internal members can be accessed within the same assembly, but not another. Internal protected members can be accessed within the same assembly or subclasses in other assemblies.

Uploaded by

dawar ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

ACCESS MODIFIERS

In this Session we will learn about different Access


Modifiers that can be applied for Type Member.
Here are Five Access Modifiers-
.Public.Private .Protected .Internal .Internal
Protected
By: MIRZA GHAZANFAR BAIG
Here are Five Access Modifiers in C#
1. Public
2. Private
3. Protected
4. Internal
5. Internal Protected

 By: MIRZA GHAZANFAR BAIG


PUBLIC:-
The type or member can be accessed by any other code
in the same assembly or another assembly that references it.

PRIVATE:-
The type or member can only be accessed by code in
the same class or structure.

PROTECTED:-
The type or member can accessed by code in the same
class or structure, or in a derived class.

By: MIRZA GHAZANFAR BAIG


INTERNAL:-
The type or member can be accessed by any code in the
same assembly, but not from another assembly.

INTERNAL PROTECTED:-
The type or member can be accessed by any code in the
same assembly, or by any derived class in another assembly.

By: MIRZA GHAZANFAR BAIG


Access modifier in one short
Access Modifier Accessibility

Public Any Where No Restriction.

Private Only within the Containing Class.

Protected With in the type and the type Derived from the Containing type.

Internal Any where within the Containing Assembly.

Internal Protected Any where within the Containing Assembly, and within the derived class in any other
Assembly.

NOTE: - When no access modifiers set, a default access modifier is used. So there is always some form of
access modifier even if it's not set.
By: MIRZA GHAZANFAR BAIG
THANK YOU!

By: MIRZA GHAZANFAR BAIG

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy