this 关键字的用法
using System;
class Number
{
public int i;
public Number(int initval)
{
this.i = initval;
}
public static Number operator ++(Number arg)
{
return new Number(arg.i +1);
}
}
class test
{
static void Main()
{
Number Obj1 = new Number(1);
Number Obj2 = Obj1++;
Console.WriteLine(Obj1.i);
Console.WriteLine(Obj2.i);
Obj2 = ++Obj1;
Console.WriteLine(Obj1.i);
Console.WriteLine(Obj2.i);
}
}