Stop executing further code in Java

后端 未结 6 2007
失恋的感觉
失恋的感觉 2021-01-01 16:25

I have looked in the Javadoc but couldn\'t find information related to this.

I want the application to stop executing a method if code in that method tells it to do

6条回答
  •  [愿得一人]
    2021-01-01 17:19

    return to come out of the method execution, break to come out of a loop execution and continue to skip the rest of the current loop. In your case, just return, but if you are in a for loop, for example, do break to stop the loop or continue to skip to next step in the loop

提交回复
热议问题