# 054 TestTernaryOP.java /* * 此範例為三元運算子測試 * 可自行更換變數值比較結果 */ public class TestTernaryOP { public static void main(String[] args) { int income = 10000, outcome = 12000; System.out.println((income > outcome) ? "有積蓄" : "入不敷出"); } //三元運算(boolean值:數值b:數值c); }
×
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