网友您好, 请在下方输入框内输入要搜索的题目:
阅读以下说明和java代码,将应填入(n)处的字句写在对应栏内。
[说明]
本程序使用类来管理员工的通讯地址信息。已知程序的输出为:
输出记录:5
姓名:王丽华
街道地址:中华路15号
市:襄樊市
省:湖北省
邮政编码:430070
[Java代码]
public class Employee{
protected String (1);
protected String street;
protected String city;
protected String prov;
protected String post;
protected int no;
public Empbyee(){}
public Employee(String name,String street,String city,String prov,String post, (2) ){
this.name=name;
this.street=street;
this.city=city;
this.prov=prov;
this.post=post;
this.no=no;
}
public static void main(String[]args){
Employee emp=new Employee(“王华”,“中华路15号”,“武汉市”,“湖北省”,“430070”,1);
emp.changeName(“王丽华”);
(3) (“襄樊市”);
emp.changeNo(5);
(4);
}
void changeName(String name){this.name=name;}
void changeStreet(String street){this.street=street;}
void changeCity(String city){this.city=city;}
void changeProv(String prov){this.prov=prov;}
void changeNo(int no){(5);}
void display(){
System.out.println(“输出记录:”+this.no);
System.out.Println(“姓名:”+this.name);
System.out.println(“街道地址:”+this.street);
System.out.println(“市:”+this.city);
System.out.println(“省:”+this.prov);
System.out.println(“邮政编码:”+this.post);
}
}
参考答案