正在加载图片...
条件运算符 Another example. System. out. printIn( Your change is "+ count (count ==1)? Dime":"Dimes)); If count equals 1, then Dime is printed If count is anything other than 1, then"Dimes is printed JAVA13 条件运算符 • Another example: System.out.println ("Your change is " + count + ((count == 1) ? "Dime" : "Dimes")); • If count equals 1, then "Dime" is printed • If count is anything other than 1, then "Dimes" is printed
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有