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循环后面加一个分号,输出结果完全不一样。

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

相关文章:

  • 2022-12-23
  • 2021-05-05
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-12-17
  • 2021-11-21
  • 2022-12-23
猜你喜欢
  • 2021-05-03
  • 2022-12-23
  • 2021-06-04
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案