Cannot convert from method group to Int32

后端 未结 3 1826
孤城傲影
孤城傲影 2021-01-22 00:25

I want my small math program to look really sleek, and by this I mean under the Main method I have the following methods:

Greet()
UserInput1()
UserI         


        
3条回答
  •  悲&欢浪女
    2021-01-22 01:08

    change this:

    result(firstNumber, secondNumber);
    

    to this:

    result(firstNumber(), secondNumber());
    

    and remove the calls to the 2 methods in the two lines above.

    To call a method without parameters, you need the parentheses without content.

提交回复
热议问题