Professional Documents
Culture Documents
VTU DotNet Module 2 by Keval M Jain
VTU DotNet Module 2 by Keval M Jain
Encapsulation:
Encapsulation is defined as the wrapping up of data under a single unit.
It is the mechanism that binds together code and the data it manipulates.
In a different way, encapsulation is a protective shield that prevents the
data from being accessed by the code outside this shield.
Where,
Ex:
Struct and class in C#:
Structures in C#:
EX:
O/P:
Constructors in C#:
EX: (this can be used for default, parameterized and constructor overloading)
Copy Constructor:
Example:
Static Constructor:
Ex:
Private Constructor:
Ex:
Constructor Overloading:
//Same example can be used which was used for default and parameterized
constructors. Also check for all constructors in 1 program ex at end of pdf…
ARRAYS IN C#:
Assigning values:
Ex:
o/p:
False
False
True
True
True
AS Operator:
Ex:
o/p:
----------------------------------END---------------------------------------------------