美文网首页
continue、break、return的使用

continue、break、return的使用

作者: huicuihui | 来源:发表于2017-12-14 21:14 被阅读21次

continue

在一个for循环里面,continue是跳过continue下面语句的执行,结束了这一次循环,直接跳到进行下一次循环。只是跳过了这一次下面的语句。

break

break是直接跳出for循环语句, 结束了for循环,不再进行for循环。

return

return是直接结束return所在的方法。

相关文章

网友评论

      本文标题:continue、break、return的使用

      本文链接:https://www.haomeiwen.com/subject/cyylwxtx.html