i cant figure out...whats wrong in this code:
it gives the following Error:"No overload for method YYY takes 1 arguments"
Code:
static void Main(string[] args)
{
YYY t = new YYY();
t.I =10;
YYY f = new YYY();
f.I =50;
YYY c;
c=t+f;
}
}
public class YYY
{
public int I
{
get { return i; }
set {i=value; }
}
private int i;
public static YYY operator+(YYY a,YYY b)
{
YYY z = new YYY(a.I + a.I);
return z;
}
}
it gives the following Error:"No overload for method YYY takes 1 arguments"