返回列表 發帖

do...while

本帖最後由 tonyh 於 2012-9-8 17:00 編輯

至少會執行一次, 無論 while 是否符合條件.
  1. public class ch25
  2. {
  3.     public static void main(String args[])
  4.     {
  5.           int i=100;
  6.           do
  7.           {
  8.                System.out.println("至少執行一次!");
  9.           }while(i!=100);
  10.     }
  11. }
複製代碼

返回列表