public class OPDemo3
{
public static void main(String[] args)
{
      int v1=1,v2=1,v3=1,v4=1;
      boolean t= v1++>1 && v2+1>1 ;
      System.out.printf("大於小於符號優先++ 如果v1運算是flase &&後面的運算就不做\n\n");
      System.out.printf("v1++>1 && v2++>1 v1=%d V2=%d\n\n",v1,v2);
      boolean t1= v3++>1 && v4++>1 ;
      System.out.printf("大於小於符號優先++ 現在v4運算是ture &&後面的運算就不做\n\n");
      System.out.printf("v3++>1 && v4++>1 v3=%d V4=%d",v3,v4);
   }
}

 

//Ans : v1=2 V2=1 v3=2 V4=1

arrow
arrow
    全站熱搜

    wealthy 發表在 痞客邦 留言(0) 人氣()