Properties are members of classes. They are also used in structs and interfaces.
Properties are an extension of fields but they do not designate storage locations.
Properties provide a flexible mechanism to read, write, or compute the values of private fields through accessors that read, write, or compute their values.
Below example shows car Model and car Make properties for Car class
Code
using System;
class Car
{
private string carModel ="Ambasador";
private int carMake = 0;
public string Model
{
get
{
return carModel;
}
set
{
carModel = value;
}
}
public string Make
{
get
{
return carMake;
}
set
{
carMake = value;
}
}
}

3 Users have rated as useful.
Login to rate this answer.
Properties combine the behavior of method & variable.
Login to rate this answer.