# 069 TestSwitchCase.java public class TestSwitchCase { public static void main(String[] args) { int n = 10; // 10 20 30 switch (n) { //switch(n)n只能是整數int、字元char;整數long不行、浮點數不行 case 10: System.out.println("n 的值是 10"); break; case 20: System.out.println("n 的值是 20"); break; default: System.out.println("n 的值不是 10 也不是 20"); } System.out.println("我仍有執行到!"); } }
×
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