日期:2014-05-18 浏览次数:20759 次
public static void main(String[] args)
{
int i = 1;
int j = 1;
//可以通过编译的:
//通俗点讲:++只能是紧挨着i,或紧挨着j,否则的++就编译不过;
i = i + + j; //++写道一块就是错的;
System.out.println(i);
//++写到i的后面;
i = 1;
j = 1;
i = i ++ + j;
System.out.println(i);
i = 1;
j = 1;
i = i ++ + + j;
System.out.println(i);
i = 1;
j = 1;
i = i ++ + + + j;
System.out.println(i);
i = 1;
j = 1;
i = i ++ + + + + j;
System.out.println(i);
//例如,不能通过编译的:i = i ++ ++ + j;
System.out.println("--------------");
//++放到j的前面
i = 1;
j = 1;
i = i + ++ j;
System.out.println(i);
i = 1;
j = 1;
i = i + + ++ j;
System.out.println(i);
}