我需要從另一個主體調用一個構造函數,該怎麼做?C#從另一個主體調用一個構造函數
基本上
class foo {
public foo (int x, int y)
{
}
public foo (string s)
{
// ... do something
// call another constructor
this (x, y); // doesn't work
foo (x, y); // neither
}
}
如何像公共富(INT X,INT Y,字符串s) –