当前位置: 技术问答>java相关
请教个简单的问题。谢谢
来源: 互联网 发布时间:2015-06-07
本文导语: public class Circle{ public double x,y,r; public Circle(double x,double y, double r){ this.x = x; this.y = y; this.r = r; } publ...
public class Circle{
public double x,y,r;
public Circle(double x,double y, double r){
this.x = x;
this.y = y;
this.r = r;
}
public Circle(Cricle c){
this(c*x, c*y, c*r);
}
}
其中this(c*x, c*y, c*r)是什么语法?特别是c*x...是什么意思?谢谢
public double x,y,r;
public Circle(double x,double y, double r){
this.x = x;
this.y = y;
this.r = r;
}
public Circle(Cricle c){
this(c*x, c*y, c*r);
}
}
其中this(c*x, c*y, c*r)是什么语法?特别是c*x...是什么意思?谢谢
|
this(c*x, c*y, c*r)是你写错了吧
应该是this(c.x,x.y,c.r)才对
this可看做是当前class的一个句柄
应该是this(c.x,x.y,c.r)才对
this可看做是当前class的一个句柄
|
肯定是写错了,这是个调用自己这个类为参数的语句!