JiafanZhou
版主
发贴: 736
积分: 61
|
于 2008-09-29 16:39
IMHO, using "?:" properly can greatly simplify the code. And it is really a matter of taste of each individual Java programmer. Once you get used to "?:", you will find the code is more readable and easier to understand.
Actually, it is called shortcut version (or compact version) of if-else statement. In other words, they are the same from a compiler's perspective.
Regards, Jiafan
When I was a kid I used to pray every night for a new bike. Then I realized that The Lord doesn't work that way, so I stole one and asked him to forgive me.
|