标签:style blog color java div log ad ef
if (x < 1) System.out.print(x + " < 1"); else if (x > 1) System.out.print(x + " > 1"); else System.out.print(x + " == 1");
switch (y) { case 0: System.out.print(y + " is 0"); break; case 1: System.out.print(y + " is 1"); break; default:System.out.print(y + " is something else"); }
x = (x < 0.5) ? 0 : 1;
If x < 0.5
x = 0;
else
x = 1 ;
Java 语法 索引 ----- 条件语句(If Else,Switch),布布扣,bubuko.com
Java 语法 索引 ----- 条件语句(If Else,Switch)
标签:style blog color java div log ad ef
原文地址:http://www.cnblogs.com/timba/p/3900447.html