package com.lianxi;
public class Demo1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Address add=new Address("中国", "广东","梅州","西乡","123");
System.out.println("国家:"+add.getNational()+" 省份:"+add.getProvincial()
+" 城市:"+add.getCity()+" 街道:"+add.getStreet()+" 邮编:"+add.getZipcode());
}
}
class Address
{
private String national;
private String provincial;
private String city;
private String street;
private String zipcode;
public String getNational() {
return national;
}
public void setNational(String national) {
this.national = national;
}
public String getProvincial() {
return provincial;
}
public void setProvincial(String provincial) {
this.provincial = provincial;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getZipcode() {
return zipcode;
}
public void setZipcode(String zipcode) {
this.zipcode = zipcode;
}
public Address(String national,String provincial,
String city,String street,String zipcode)
{
this.national=national;
this.provincial=provincial;
this.city=city;
this.street=street;
this.zipcode=zipcode;
} |
|