我可以从C+中的另一个构造函数(做构造函数链)调用构造函数吗?
class Test {
public Test() {
DoSomething();
}
public Test(int count) : this() {
DoSomethingWithCount(count);
}
public Test(int count, string name) : this(count) {
DoSomethingWithName(name);
}}
小怪兽爱吃肉
湖上湖
随时随地看视频慕课网APP
相关分类