请高手给于程序案例!
------解决方案--------------------
纯数据类,没什么需要测试的。
- Java code
public final class Address { public final String country; public final String province; public final String city; public final String street; public final String postcode; public Address(String country,String province,String city,String street,String postcode){ this.country = country; this.province = province; this.city = city; this.street = street; this.postcode = postcode; } @Override String toString(){ return String.format("Address[country:%s, province:%s, city:%s, street:%s, postcode:%s]",country,province,city,street,postcode); }}