See the below code:
Public class Employee
{
int Id;
string Name;
public Employee(int Id)
{
this.Id = Id;
}
}
Employee emp = new Employee(1);
In the below code
emp
is the object, it holds instance of the employee.
public Employee(int Id)
The above line is the constructor, which is used to initialize object while creation.