2008年8月28日 星期四

Java 三元運算子

int a=5,b=3,z
if(a>b){
z=a;
}
else{
z=b
}
可寫成
z=(a>b)?a:b;