{ ?? public static void main (String[]arge){ ?? ?int o = 10 ; ??? int p = 20 ; ??? int a = (o+p);?????????????????????? //a=30 ??? int b = (a+=o);??????????????????? //a=40 b=40,此時a的值已改變 ??? int c = (b-=o);???????????????????? //b=30 c=30,此時b值已改變 ??? long d = (c*=o);???????????????? //c=300 d=300,此時c值已改變
??? long e = (d/=o);???????????????? //d=30 e=30,此時d值已改變
??? long f = (e%=o);//e=0 f=0 ??? System.out.println("three = one + two ==>"+a);????????? //輸出值為改變后的值40 ??? System.out.println("three += one ==>"+b); ??? System.out.println("three -= one ==>"+c); ??? System.out.println("three *= one ==>"+d); ??? System.out.println("three /= one ==>"+e); ??? System.out.println("three %= one ==>"+f); ???? ?
2017-05-11
{
?? public static void main (String[]arge){
?? ?int o = 10 ;
??? int p = 20 ;
??? int a = (o+p);?????????????????????? //a=30
??? int b = (a+=o);??????????????????? //a=40 b=40,此時a的值已改變
??? int c = (b-=o);???????????????????? //b=30 c=30,此時b值已改變
??? long d = (c*=o);???????????????? //c=300 d=300,此時c值已改變
??? long e = (d/=o);???????????????? //d=30 e=30,此時d值已改變
??? long f = (e%=o);//e=0 f=0
??? System.out.println("three = one + two ==>"+a);????????? //輸出值為改變后的值40
??? System.out.println("three += one ==>"+b);
??? System.out.println("three -= one ==>"+c);
??? System.out.println("three *= one ==>"+d);
??? System.out.println("three /= one ==>"+e);
??? System.out.println("three %= one ==>"+f);
???? ?
}
}
2017-05-11
最后兩個}}請無視,大家試試這段代碼輸出有什么問題