📄 holiday_co.java
字号:
package biz;
import java.io.Serializable;
/**
* 度假村类
* 包括的属性有:序号,名字,城市名称,小别墅总数,可预定的别墅数目
* 以及相关的获取以及设置属性方法
* @author 邹志军
*
*/
public class Holiday_co extends Hotel_Holiday implements Serializable{
private int num;//编号
private String name;//度假村名字
private String city_name;//城市名字
private int home_num; //别墅总数
private int home_num_have; //可预定的别墅总数
private int home_price; //别墅价格
public Holiday_co() {
// TODO 自动生成构造函数存根
}
/**
*
* @param num
* @param name
* @param city_name
* @param home_num
* @param home_num_have
* @param home_price
*/
public Holiday_co(int num,String name,String city_name,int home_num,int home_num_have,
int home_price ) {
this.num=num;
this.name=name;
this.city_name=city_name;
this.home_num=home_num;
this.home_num_have=home_num_have;
this.home_price=home_price;
}
public void setNum(int num) {
this.num = num;
}
public void setName(String name) {
this.name = name;
}
public void setCity_name(String city_name) {
this.city_name = city_name;
}
public void setHome_num(int home_num) {
this.home_num = home_num;
}
public void setHome_num_have(int home_num_have) {
this.home_num_have = home_num_have;
}
public void setHome_price(int home_price) {
this.home_price = home_price;
}
public int getNum() {
return num;
}
public String getName() {
return name;
}
public String getCity_name() {
return city_name;
}
public int getHome_num() {
return home_num;
}
public int getHome_num_have() {
return home_num_have;
}
public int getHome_price() {
return home_price;
}
/**
* 度假村信息输出方法
* 输出度假村所有信息
*/
public void print()
{
System.out.println("Hotel code:"+getNum()+" Name:"+getName());
System.out.println("Total cottages:"+home_num+" Tariff:"+home_price+
" Available:"+home_num_have);
}
public String toString(){
return getNum()+"\t"+getName()+"\t"+getCity_name()+"\t"+
getHome_num()+"\t"+getHome_price();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -