【发布时间】:2015-08-22 03:27:18
【问题描述】:
简单代码:
class foo
{
private int a;
private int b;
public foo(int x, int y)
{
a = x;
b = y;
}
}
class bar : foo
{
private int c;
public bar(int a, int b) => c = a * b;
}
Visual Studio 抱怨 bar 构造函数:
错误 CS7036 没有给出与
foo.foo(int, int)的所需形参x相对应的参数。
什么?
【问题讨论】:
标签: c# inheritance constructor