public static void main(String[] args) {String firstName = /*...*/; String lastName = /*...*/;// Construct a customerCustomer customer = new Customer();// Set important properties (but not the address)customer.setName(firstName, lastName);// Save the customercustomer.save();}public class Customer {private Address address;// ...// This setter and getter are unused, and so may be deleted.public void addAddress(String line1, String line2, String line3) {address = new Address(line1, line2, line3);}public Address getAddress() { return address; }}/** This class is only constructed from dead code, and may be deleted.*/public class Address {// ...public Address(String line1, String line2, String line3) {// ...}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。