支持下小仙,这种方法我也觉得蛮好啊,大家互相交流才能提高嘛。而且还有一个共同的话题。
不过你的问题我不理解。不明白你的意思哎。你的this到底是指在哪里调用啊?
public class Point
{ public int x, y;
public Point(int x, int y)
{
this.x = x;
this.y = y;
}
}
public class Point3D: Point
{
public int z;
public Point3D(int x, int y, int z): base(x, y)
{
this.z = z;
}
}
====================================================
Point a = new Point(10, 20);
Point b = new Point3D(10, 20, 30);