public class Point
{
public int a, b;
public Point1(int x, int y)
{
this.a = x;
this.b = y;
}
public Point2(int x,int y)
{
this.Point1(x,y);
}
}
請問各位高手,如果把所有this去掉,代碼與原來會有什麼差別呢。
{
public int a, b;
public Point1(int x, int y)
{
this.a = x;
this.b = y;
}
public Point2(int x,int y)
{
this.Point1(x,y);
}
}
請問各位高手,如果把所有this去掉,代碼與原來會有什麼差別呢。
{
this.a = a;
this.b = b;
}
this本身就代表当前对象,去掉也不影响,因为a,b本身就是类成员