
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What are access specifiers in C#.NET?
To define the scope and visibility of a class member, use an access specifier.
C# supports the following access specifiers −
- Public
- Private
- Protected
- Internal
- Protected internal
Let us learn about them one by one.
Public Access Specifier
It allows a class to expose its member variables and member functions to other functions and objects.
Private Access Specifier
Private access specifier allows a class to hide its member variables and member functions from other functions and objects. Only functions of the same class can access its private members.
Protected Access Specifier
Protected access specifier allows a child class to access the member variables and member functions of its base class.
Internal Access Specifier
Internal access specifier allows a class to expose its member variables and member functions to other functions and objects in the current assembly.
Protected Internal Access Specifier
The protected internal access specifier allows a class to hide its member variables and member functions from other class objects and functions, except a child class within the same application.
- Related Articles
- What are the different access specifiers in C#.NET?
- What are the differences between protected and default access specifiers in Java?
- What are the differences between public, protected and private access specifiers in C#?
- What are type specifiers in C++?
- What are different format specifiers used in C language?
- What are access modifiers and non-access modifiers in Java?
- What are access modifiers in C++?
- Format specifiers in C
- What are Remote Access Trojans?
- Space format specifiers in Java
- What are the differences between access modifiers and non-access modifiers in Java?
- What are the differences between .com and .net domains?
- What are the differences between .net and .org domain?
- What are Vector-Access Memory Schemes in Computer Architecture?
- What are the different access technologies in computer networks?
