黑马程序员技术交流社区

标题: 处理优化构造函数初始化 [打印本页]

作者: 彭小康    时间: 2012-12-13 14:08
标题: 处理优化构造函数初始化
Rectangle() {

this(0,0,0,0);

}

Rectangle(int width, int height) {

this(0,0,width,height);

}

Rectangle(int x, int y, int width, int height) {

this.x = x;

this.y = y;

this.width = width;

this.height = height;

}





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2