java x++与++x运算

public class Multiply { public static void main (String[] args) { final int SIZE = 10; int x = 0; while (x<SIZE) { x++; int y=0; while (y<SIZE) { y++; int z = x*y; if (z<10) System.out.print(" "); if (z>=100) System.out.print(" "); System.out.print(" " +z); } System.out.println(); } }}
如果X++是先计算,再自加1,可是没有式子算啊,那么是不是直接就 =1?
y++先算z=1*0 y=1 ?
这样的话 print 是 空格+0 啊。。

为什么电脑运行出来是这个

求详细解释 ++X 与++X,

X++是如果是"a=x++;";就是先把x的值赋给a; 再X自加,反则先自加,再把自加后的值赋给a;如果就单单一个语句“X++;”的话与"++X"没区别;


可能我的回答不能让你满意但希望能让你的问题更加清晰。 

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-09-25
X++是先计算,再自加1,++x是
第2个回答  2013-09-25
++X 和X++都相当于x=x+1;但前者是先给自己加1后赋值给自己,后者是给自己赋值后给自己加1
第3个回答  2013-09-25
很简便理解这个

++ 在前,就是先加再取值
++ 在后,就是先取值再加

X=1

System.out.println(++X ); //2

System.out.println(X++ ); //1