TestWhile04.java 606 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * ClassName: TestSwitch01
  3. * Package: PACKAGE_NAME
  4. * Description:
  5. *
  6. * @Author 爱扣钉-陈晨
  7. * @Create 2023/9/17 10:23
  8. * @Version 1.0
  9. */
  10. public class TestWhile04 {
  11. public static void main(String[] args) {
  12. //循环10次helloworld
  13. int i = 0;
  14. while ( i < 10 ){
  15. System.out.println("行号"+ (i+1)+ " helloworld");
  16. i++;
  17. }
  18. /*
  19. 初始化 int i = 0;
  20. 条件判断 ( i < 10 )
  21. 循环体 System.out.println("行号"+ (i+1)+ " helloworld");
  22. 迭代 i++;
  23. */
  24. }
  25. }