السلام عليكم و رحمة الله و بركاته
اخواني قمت بكتابة indexer بسيط و لكن يظهر لي رسالة " process is terminated due to stack overflow exception" و هذا هو الكود
class MyClass
{
public string str1
{
get
{
return "hi there";
}
set
{
str1 = value;
}
}
}
class Program
{
static void Main(string[] args)
{
MyClass m1 = new MyClass();
m1.str1 = "nice";
System.Console.WriteLine("str1= {0}",m1.str1);
}
}
و جزا الله خيرا