JAVA标签使用

末蓝、 2022-05-17 07:10 257阅读 0赞
  1. public static void main(String[] args) {
  2. int i = 0;
  3. // 标签 ,写法: 标签名+ “:” 如 lable:
  4. label:
  5. while (true) {
  6. i++;
  7. System.out.println("entry " + i);
  8. // break + 标签,跳出循环,并到标签处,下次不再进入循环;
  9. //break label;
  10. // continue + 标签,跳出循环,从标签处继续执行,可继续进入循环条件
  11. continue label;
  12. }
  13. }

发表评论

表情:
评论列表 (有 0 条评论,257人围观)

还没有评论,来说两句吧...

相关阅读

    相关 a标签使用

    a表示超链接 属性href 表示目标页面的地址 属性\_target 默认值self在当前页面打开取代 属性 \_blank另打开一个空白页面 属性\_top在顶层

    相关 Spring标签使用

    主要记录在做项目的过程中使用到的标签, 简单的一些个人理解,并不包含详细的用法。 注:标签需要使用context:component-scan元素启动“包扫描”功能