// Get DfpUser from "~/dfp.properties".
DfpUser user = new DfpUser();
// Get the ContactService.
ContactServiceInterface contactService =
user.getService(DfpService.V201311.CONTACT_SERVICE);
// Set the ID of the contact to update.
Long contactId = Long.parseLong("INSERT_CONTACT_ID_HERE");
// Get the contact.
Contact contact = contactService.getContact(contactId);
// Update the address of the contact.
contact.setAddress("123 New Street, New York, NY, 10011");
// Update the contact on the server.
Contact[] contacts = contactService.updateContacts(new Contact[] {contact});
for (Contact updatedContact : contacts) {
System.out.printf(
"Contact with ID \"%d\", name \"%s\", and address \"%s\" was updated.\n",
updatedContact.getId(), updatedContact.getName(), updatedContact.getAddress());