Resolving “The method must return a result of type int” in Java

后端 未结 9 656
庸人自扰
庸人自扰 2021-01-21 12:37

I\'m very new to Java. Eclipse is giving me the error

The method must return a result of type int

for the following code:



        
9条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-21 13:26

    During compilation time, your compiler cannot find the parallel else condition of (a>b) that is => if(a<=b)

    what it will return if your input matches this block? So you should provide this

提交回复
热议问题