import com.google.common.base.Objects; public class Person { private String name; private int age; public Person(String name, int age) { this.name = name; this.age = age; } @Override public String toString() { return Objects.toStringHelper(this) .add("name", name) .add("age", age) .toString(); } }In this example, we create a new toStringHelper object using the current Person object as the parameter. We then use the add method to add the name and age fields to the string representation. Finally, we call the toString method of the helper object to retrieve the complete string representation of the Person object. The com.google.common.base package is part of the Google Guava library, which provides a collection of utilities for Java programming.