Java - Does returning a value break a loop?

前端 未结 5 1588
时光说笑
时光说笑 2020-12-02 10:42

I\'m writing some code that basically follows the following format:

public static boolean isIncluded(E element) {
    Node c = head;
    while (c !=         


        
5条回答
  •  情话喂你
    2020-12-02 11:05

    Return does break the loop and returns from the entire method immediately. The only code that will be executed on the way out is the body of a finally clause and the release of any synchronized statement.

提交回复
热议问题