日期:2014-05-17 浏览次数:20867 次
public class Point
{
private int i;
private int j;
public Point() { }
public Point Add(Point p)
{
Point rtn = new Point();
rtn.i = this.i + p.i;//p.i?i和j不是private么,对象实例怎么可以访问?
rtn.j = this.j + p.j;
p.Print();//直接访问私服方法?
return rtn;
}
public Point(int x, int y)
{
i = x;
j = y;
}
private void Print()
{
}
public override string ToString()
{
return i + "," + j;
}
}