Java程序设计Rectangle类的定义和使用如图
1个回答
2017-03-14 · 知道合伙人互联网行家
关注
展开全部
public class Rectangle{
private int width;
private int height;
public Rectangle(){
this.width = 10;
this.height = 10;
}
public Rectangle(int width, int height){
this.width = width;
this.height = height;
}
public int area(){
return width * height;
}
/绝亮/省高宏虚略getter/戚燃setter
}
private int width;
private int height;
public Rectangle(){
this.width = 10;
this.height = 10;
}
public Rectangle(int width, int height){
this.width = width;
this.height = height;
}
public int area(){
return width * height;
}
/绝亮/省高宏虚略getter/戚燃setter
}
追问
看清题目
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |