this method must return a result of type boolean, java

前端 未结 5 1278
孤独总比滥情好
孤独总比滥情好 2020-11-28 16:04
 public boolean Winner() {
    for (int z = 0; z < 3; z++) {
            if (board[z] != null && board[z] == board[z+3] && board[z] == board[z+6]
         


        
5条回答
  •  粉色の甜心
    2020-11-28 16:52

    All possible ways that the method can exit need to return something. If your code makes it through both for loops without having an if condition evaluate to true, then you need a return at the end that specifies what gets returned.

提交回复
热议问题