Is there a way to ignore the 'Unreachable statement' error?

后端 未结 5 516
耶瑟儿~
耶瑟儿~ 2020-12-13 17:41

Is it possible to somehow ignore this error? I find it much easier to just put return in front of the code I don\'t want to run than to comment it (when the com

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 17:44

    you have to fix that unreachable code.

    public void display(){
      return; //move the return statement to appropriate place
      int i;
    }
    

    compiler will not compile your source code. you have to take care of your source code that every line is reachable to compiler.

提交回复
热议问题