# 074 TestWhile.java + TestDoWhile.java 1.TestWhile.java /*此範例為while迴圈測試*/ public class TestWhile { public static void main(String[] args) { int i = 100; while (i <= 10) { System.out.println(i); i++; } System.out.println("------------------------------"); { int count = 1; while (count++ < 5) System.out.println("count = " + count);} System.out.println("------------------------------"); --- 2.TestDoWhile.java /*此範例為do-while迴圈測試*/ int j = 100; do { System.out.println(j); j++; } while (j <=10);} }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up