This is my program source code:
using System;
namespace MyConsoleApp
{
public class PropertiesHolder
{
#region Fields
private int value = 5;
#endregion
public int Value
{
get
{
return Value == 5 ? 1 : 0;
}
set
{
this.value = value;
}
}
}
public class MyProgram
{
public static void Main(string[] args)
{
PropertiesHolder ph = new PropertiesHolder();
ph.Value = 10;
Console.WriteLine(p.Value); // It crashes at this line.
Console.WriteLine("Hello World!");
}
}
}
it crashes at the line number 33. i get a Stack overflow error, Why is that?
thanks