我需要从另一个构造函数中调用一个构造函数.我怎样才能做到这一点?
基本上
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
}
}
Run Code Online (Sandbox Code Playgroud)