Site icon

OOPs with C#

Object oriented programming with C#

Classes: Class is a C# construct to model real-world objects into classes

Exa:
class Employee
{
private string _name;
private char _gender;
private string _qualification;
private uint _salary;
}

Access Modifiers

Constructors: Special method of a class that is called every time an instance of the class is created

Exa:
Employee()
{
qualification = “Graduate”;
}

Destructor: Special method to perform cleanup operations

Syntax:

{
body of destructor
}

Note:

Namespcace, virtual method, abstract method

Exit mobile version