簡單的問題,我該如何解決這個問題?C#的構造函數調用
public MyClass(string s)
{
int k = s.Length;
int l = SomeFunction(s);
int m = GetNumber();
if (Valid(l, m))
{
int p = SomeOtherFunction(k, m);
MyBigObject o = new MyBigObject(p);
// here I want to call the other constructor MyClass(o)
}
}
public MyClass(MyBigObject x)
{
this.o = x;
}
聽起來像功課,我... – evilone