class MyAnd
{
public static void main(String [] args)
{
System.out.println("++在前是先自增 后运算"+GetNumPlus(4));
System.out.println("++在后是先运算 后自增"+GetPlusNum(4));
}
//++在前是先自增 后运算
public static int GetNumPlus(int num)
{
return ++num;
}
//++在后是先运算 后自增
public static int GetPlusNum(int num)
{
return num++;
}
} |
|