hotel.java
来自「旅馆预订系统.采用jstl+oracle,jsp/servlet,,供初学者学习」· Java 代码 · 共 92 行
JAVA
92 行
package HotelSystem;
class Hotel extends Houses {
private int Id;
private String name;
private String city;
private int rcount = 100;
private int dcount = 100;
private int rprice;
private int dprice;
public int getId() {
return Id;
}
public void setId(int id) {
Id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public int getDcount() {
return dcount;
}
public void setDcount(int dcount) {
if (dcount >= 0) {
this.dcount = dcount;
} else {
System.out.println("普通房间不够!!");
}
}
public int getDprice() {
return dprice;
}
public void setDprice(int dprice) {
if(dprice> 95){
this.dprice = dprice;
}
else
{
System.out.print("金额必须大于95");
}
}
public int getRprice() {
return rprice;
}
public void setRprice(int rprice) {
if (rprice > 45) {
this.rprice = rprice;
} else {
System.out.print("金额必须大于45");
}
}
public int getRcount() {
return rcount;
}
public void setRcount(int rcount) {
if (rcount >= 0) {
this.rcount = rcount;
} else {
System.out.println("豪华房间不够!!");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?