- 第一题
- int x = 1,y = 1;
- if(x++==2 & ++y==2) {
- x =7;
- }
- System.out.println("x="+x+",y="+y);
- x=2 y=2
- ---------------------------------------------------
- 第二题
- int x = 1,y = 1;
- if(x++==2 && ++y==2)
- {
- x =7;
- }
- System.out.println("x="+x+",y="+y);
- x=2 y=1
- ---------------------------------------------------
- 第三题
- int x = 1,y = 1;
- if(x++==1 | ++y==1)
- {
- x =7;
- }
- System.out.println("x="+x+",y="+y);
- x=7 y=2
- ---------------------------------------------------
- 第四题
- int x = 1,y = 1;
- if(x++==1 || ++y==1)
- {
- x =7;
- }
- System.out.println("x="+x+",y="+y);
- x=7 y=1
- ---------------------------------------------------
复制代码 |