class MyBox
{private int x,y,with,height;
MyBox()
{x=0;y=0;width=0;height=0;
}
MyBox(int x, int y,int width,int height)
{this,x=x;this,y=y;this,width=width;this,height=height;
}
public void set(int x, int y,int width,int height)
{this,x=x;this,y=y;this,width=width;this,height=height;
}
{private int x,y,with,height;
MyBox()
{x=0;y=0;width=0;height=0;
}
MyBox(int x, int y,int width,int height)
{this,x=x;this,y=y;this,width=width;this,height=height;
}
public void set(int x, int y,int width,int height)
{this,x=x;this,y=y;this,width=width;this,height=height;
}
this.x=x;
this.y=y;
this.width=width;
this.height=height;
}
请赐教”
不知道你说的什么意思?!!!!!
看看下面是不是你想要的?!class MyBox {
private int x,y,with,height; MyBox(){
x=0;
y=0;
width=0;
height=0;
set(x,y,width,heigh);
} public void set(int x,int y,int width,int heigh{
this.x=x;
this.y=y;
this.width=width;
this.height=height;
}
class MyBox {
private int x,y,with,height; private MyBox(int x,int y,int width,int heigh){ //不能用此构造对象
x=0;
y=0;
width=0;
height=0;
} public static void set(int x,int y,int width,int heigh){//类方法只能构造一个对象
MyBox myBox=new MyBox(x,y,width,heigh);
}