class point
{
private double pi;
public double PI
{
get{ return pi; }
set{ pi = value;}
}
}
class Program
{
static void Main(string[] args)
{
point p1=new point();
p1.PI = 3.14;
Console.WriteLine("The value is {0}",p1.PI);
Console.ReadLine();
}
}
Actually i couldn't understand the use of PROPERTIES concept....
Here i used Two variables rather than using one variable... It's simply leads to more memory consumption.... Then what is the real benefit behind the PROPERTIES concept... ?
Somebody says that,it provides security,but here still anyone can edit the value of PI. Then how we can say it as a secured one....