public class Eddy{
public static void main (String args []) {
int i=1;
int j=i++;
if ((i == (++j) ) & ( (i++) ==j )){
i+=j;
}
System.out.println(i);
}
}
/*解析如下:
* int i=1;
* int j=i++;相当于int j=2; 3&2为真
* i=i+j
* if((i==3)&((i==2)){
* 这里的&位运算中的的逻辑与操作符
* 所以结果为5
*
*/
这种题目考查的是对if..else语句的理解程度
这个程序中 if ((i == (++j) ) & ( (i++) ==j )){这里为true
Therefore ,this issue the result of:
5