Well...yes - it will...
public static int eno
{
get {
return 1;
}
set {
eno = value;
}
}
So
eno = 5;
Calls the setter, which does:
int value = 5;
eno = 5;
Which calls the setter, which does:
int value = 5;
eno = 5;
Which calls the setter, which does:
int value = 5;
eno = 5;
...
You can't set the value of a property from within the property!
Try this:
private static int _Eno
public static int Eno
{
get {
return 1;
}
set {
_Eno = value;
}
}
Though why you return a constant value from the getter is anyones guess!