Access
Modifier In C#
Access modifiers are determined the scope of visibility for variables and methods. So in a nutshell access modifiers are keywords that control the visibility of class members and other code constructs.
Public: - Public members are accessible anywhere, inside
the type (e.g. - class), outside the type, inside the assembly,
outside the assembly, through the inheritance, or with the type (e.g. an instance of a class, with the type of class in case of static).
Private: - Private members are only accessible within their own type
(Own class).
Protected: - Protected member is accessible only with its derived
types whether it is inside the assembly or outside the assembly.
Internal: - Internal member is accessible only within the
assembly by inheritance (its derived type) or by an instance of the class.
Structures:
·
It is a collection of heterogonous value
type data type
·
It helps you to make a single variable hold
related data of various data type
·
The structure is used to represent a
record\
Struct keyword is used for creating structure.
0 Comments