hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › 123a › 日志

编写一个程序,说明while和do/while的区别  

2022-08-06 11:55:39 查看(44) 回复(0)

 

   int i = 0;
   while (i < 10) {
       System.out.println("javakc");
       i++;
   }
   System.out.println("Finally!");
 int i = 0;
   do {
   	System.out.println("javakc");
   	i++;
   } while (i < 10);

System.out.println("Finally!");

区别while先判断后执行

do/while限制性后判断

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部