zoukankan      html  css  js  c++  java
  • java--for循环,一个分号的区别

    
    public class Test {
     public static void main(String[] args) {
      int x=1;
      int y=1;
      for(System.out.println("a");x<3;System.out.println("b"),x++);{
       System.out.println("c");
      }
      System.out.println("*******************************");
      for(System.out.println("a");y<3;System.out.println("b"),y++){
       System.out.println("c");
      }
     }
    }
    输出结果如下:
    a
    b
    b
    c
    *******************************
    a
    c
    b
    c
    b

    在第一个for循环后面加一个分号,输出结果完全不一样。

    版权声明:本文为博主原创文章,未经博主允许不得转载。

  • 相关阅读:
    dom操作
    今天学到的知识点
    3.26随笔
    dom操作
    Ajax
    JSP、EL、JSTL
    Cookie和Session
    HttpServletResponse
    Servlet
    tomcat
  • 原文地址:https://www.cnblogs.com/penggy/p/4786483.html
Copyright © 2011-2022 走看看