class Address {
private String country;
private String province;
private String avenue;
private String zipCode;
public Address(String country,String province,String avenue,String zipCode) {
this.country = country;
this.province = province;
this.avenue = avenue;
this.zipCode = zipCode;
}
public void print() {
System.out.println("Country: "+getCountry());
System.out.println("Province: "+getProvince());
System.out.println("Avenue: "+getAvenue());
System.out.println("Zip Code: "+getZipCode());
}
public void setCountry(String country) {
this.country = country;
}
public String getCountry() {
return country;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvince() {
return province;
}
public void setAvenue(String avenue) {
this.avenue = avenue;
}
public String getZipCode() {
return zipCode;
}
public void setZipcode(String zipCode) {
this.zipCode = zipCode;
}
public String getAvenue() {
return avenue;
}
}
public class E0101 {
public static void main(String args[]) {
Address add = new Address("China","Guangdong","Avenue One","51000");
add.print();
}
}
11th Ferbruary Codes
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.