c# - 方法 'METHOD' 没有重载需要 0 个参数

标签 c# winforms overloading

我有 3 种方法。

1方法持有3000的值(value) 1方法持有0.13的值(value)

我创建了另一种方法,我想将这两个数字相乘。

public override int FishPerTank()
{                
    return 3000;                
}

public override double WeightOut(double weightOut, double weightIn)
{
    return 0.13;
}

public override int HowMuchTheFishWeighOutKG()
{
    return (FishPerTank() * WeightOut());
}

我在此处收到有关 WeightOut 的语法错误:

public override int HowMuchTheFishWeighOutKG()
{
    return (FishPerTank() * WeightOut());
}

最佳答案

WeightOut 需要 2 个参数,但您没有提供它们

关于c# - 方法 'METHOD' 没有重载需要 0 个参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11020021/

相关文章:

c# - 简易喷油器 : Registering a type with constructor argument that's based on its parent

c# - 检测 winform 中窗口的 X 按钮单击

.net - Visual Studio - 隐藏窗体中的最大化按钮

c# - 时间过得像箭一样 WinForms 中的演示

java - 使用反射查找方法是否重载

Java - 重载和覆盖

java - 函数只调用具有不同输入的同一个 block

c# - WebAPI 中的文件上传

c# - 是否可以概括元组属性?

c# - 检查是否设置了某个位