Customer类定义
class Customer {
String name,address,telephone;
String getName() {
return name;
}
void setName(String name){
this.name = name;
}
String getAddress(String address){
return address;
}
void setAddress(String address){
this.address =address;
}
String setTelephone(){
return telephone;
}
void getTelephone(){
this.telephone=telephone;
}
public static void main(String [] args){
Customer customer1 = new customer();
Customer customer2 = new customer();
customer1.setName("Zhang Feng");
customer1.setAddress("#130 Nan Road");
customer1.setTelephone("022-23503545");
customer2.setName("Jin Wei");
customer2.setAddress("#130 Bei Road");
customer2.setTelephone("022-23503546");
System.out.print("The first customer name; ");
System.out.println("customer1.getName()");
System.out.print("The first customer addrress: ");
System.out.println("customer1.getAddress()");
System.out.print("The first customer telephone");
System.out.println("customer1.getTelephone()");
System.out.print("The second customer name; ");
System.out.println("customer2.getName()");
System.out.print("The second customer addrress: ");
System.out.println("customer2.getAddress()");
System.out.print("The second customer telephone");
System.out.println("customer2.getTelephone()");
}
}