i am a newbie to c#. i was reading about properties. i have coded this and i think the result should be displayed "Value to big" but it's not showing anything. please tell me where am i wrong. thanks.
private int _age;
public int Age
{
get { return _age; }
set
{
if (value < 10)
{
Age = value;
Console.WriteLine("Value to Small");
}
else
{
Console.WriteLine("Value to Big");
}
}
}
private static void Main(string[] args)
{
var banmeet = new Program();
banmeet._age = 22;
Console.ReadLine();
}
}
}