CS7036 C# There is no argument given that corresponds to the required formal parameter of

前端 未结 2 789
你的背包
你的背包 2020-12-22 14:29

WHy im i getting this error?

namespace CalculatorTest
{
    public class Calculator
    {
        public int operand1;
        public int operand2;
        p         


        
2条回答
  •  萌比男神i
    2020-12-22 15:08

    As it is mentioned earlier You defined two parameters for constructor (operand1, operand2) but then You invoke constructor without any. So If You want to have Your code working use

    Calculator c = new Calculator(5,10);
    

提交回复
热议问题